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编译器,并与QuickBASIC和Visual Basic (DOS)等较旧的BASIC工具相关联。 评论者们讨论了微软开源其遗留BASIC工具以用于学习和修补的潜在好处。用户分享了使用FreeBASIC编译旧杂志代码的经验,并表达了对macOS支持的渴望。此外,还讨论了存档包含代码存档的旧IT杂志的问题。 讨论深入探讨了FreeBASIC和QuickBASIC之间的区别,指出了QuickBASIC集成的编辑器、解释器和帮助系统。一些用户指出FreeBASIC主要是一个编译器,而像QB64PE这样的工具是独立的IDE。 讨论进一步探讨了BASIC编译器的演变,包括Visual Basic中的原生代码编译以及运行时库的作用。还提到了一些替代方案,例如Gambas、Xojo、RAD BASIC和Twin BASIC。
相关文章
  • 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