FreeBASIC 是一个免费/开源的 BASIC 编译器,支持 Windows、DOS 和 Linux。
FreeBASIC is a free/open source BASIC compiler for Windows DOS and Linux

原始链接: https://freebasic.net/

FreeBASIC是一个免费且开源的BASIC编译器,支持Windows、DOS和Linux系统,并且在“QB”模式下兼容QuickBASIC。虽然程序通常需要修改才能适应其默认语言模式,但FreeBASIC仍然为QuickBASIC提供了一个强大、富有表现力且免费的替代方案。 它是一个自托管编译器,利用GNU binutils,能够生成各种可执行文件和库文件。FreeBASIC完全支持C库,并部分支持C++,从而能够与多种编程语言进行交互。C风格的预处理器允许使用高级宏和条件编译。其性能可与GCC等主流工具相媲美。 该项目包含编译器(fbc)、汇编器、链接器、归档器、运行时库和图形支持。它面向i386架构的不同平台,并提供与Allegro、SDL、OpenGL和Windows API等常用库的绑定。FreeBASIC支持过程式、面向对象和元编程范式,在增强的数据类型、结构和现代平台支持方面扩展了QuickBASIC的功能。它方便了各种应用程序的开发。

这个Hacker News讨论帖谈论了FreeBASIC,一个免费且开源的BASIC编译器。用户们将它与更早期的BASIC环境,如QuickBASIC和QBasic进行了比较。虽然FreeBASIC编译成可执行文件,但QuickBASIC因其集成编辑器、解释器和帮助系统于一身的可执行文件而受到赞扬,允许用户立即逐行执行代码。一些人澄清说QBasic是一个更受限的版本,缺少QuickBASIC中的编译器。该讨论帖还提到了QB64,作为QuickBASIC的现代版本,但指出它主要是一个编译器。用户们怀念起早期环境(包括VB-DOS)的便捷性,强调了它们一体化的特性和内置帮助。对于那些寻求现代开发环境的用户,也提到了带有BASIC语法高亮的VS Code扩展。
相关文章
  • BCX基础 2025-03-21
  • (评论) 2024-08-17
  • FreeDOS 1.4 发布了 2025-04-22
  • Visual Basic的历史和遗产 2025-05-11
  • QModem 4.51 源代码 2025-05-03

  • 原文

    FreeBASIC is a free/open source (GPL), BASIC compiler for Microsoft Windows, DOS and Linux.

    When used in its "QB" language mode, FreeBASIC provides a high level of support for programs written for QuickBASIC. Many programs written for QuickBASIC will compile and run in this mode with no changes needed. However, for compilation in the FreeBASIC default language mode, most substantial programs will require changes.

    • Compatible
    • Powerful
    • Expressive
    • 100% Free Software

    Simple Example showing procedures.

    1. function AddNumbers( a as integer, b as integer ) as integer

    2.         return a + b

    3. end function

    4.  

    5. sub hello( )

    6.         print "hello"

    7. end sub

    8.  

    9. declare sub myprint( num as integer )

    10.  

    11. 'Code outside any procedures is the main part of the program

    12. hello( )

    13. print AddNumbers( 1, 1 )

    14. myprint 5

    15.  

    16. sub myprint( num as integer )

    17.         print num

    18. end sub

    FreeBASIC is a self-hosting compiler which makes use of the GNU binutils programming tools as backends and can produce console, graphical/GUI executables, dynamic and static libraries. FreeBASIC fully supports the use of C libraries and has partial C++ library support. This lets programmers use and create libraries for C and many other languages. It supports a C style preprocessor, capable of multiline macros, conditional compiling and file inclusion.

    FreeBASIC has been rated close in speed with mainstream tools, such as GCC.


    The FreeBASIC project is a set of cross-platform development tools, consisting of a compiler, GNU-based assembler, linker and archiver, and supporting runtime libraries, including a software-based graphics library. The compiler, fbc, currently supports building for i386-based architectures on the DOS, Linux, Windows and Xbox platforms. The project also contains thin bindings (header files) to some popular 3rd party libraries such as the C runtime library, Allegro, SDL, OpenGL, GTK+, the Windows API and many others, as well as example programs for many of these libraries.

    FreeBASIC is a high-level programming language supporting procedural, object-orientated and meta-programming paradigms, with a syntax compatible to Microsoft QuickBASIC. In fact, the FreeBASIC project originally began as an attempt to create a code-compatible, free alternative to Microsoft QuickBASIC, but it has since grown into a powerful development tool. FreeBASIC can be seen to extend the capabilities of Microsoft QuickBASIC in a number of ways, supporting more data types, language constructs, programming styles, and modern platforms and APIs.

    Any type of program can be written with FreeBASIC, see our Gallery of Applications for some notable examples.

    Continue reading about FreeBASIC

    联系我们 contact @ memedata.com