We would like to build a community for Small Basic programmers of any age who like to code. Everyone from total beginner to guru is welcome. Click here to register and share your programming journey!


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SmallBasic Open Edition
#5
Hi,

First of all, I want to clarify that the goal here is not to create SmallBasic exactly as it was. My idea is somewhat similar to what FreeBasic did back when QBasic was becoming "outdated." FreeBasic could compile 99% of QBasic code, but at the same time, it offered much more than that old workhorse from the DOS era was capable of.

SmallBasic is still quite pleasant and usable, but unfortunately, its time is running out. If I understand correctly, it hasn’t been updated in years, and its source code is not available.

SmallBasic Open Edition is not an updated version of SmallBasic, but rather an interpreter that strives to translate the original SmallBasic code into C# as accurately as possible, and then leverages the existing C# compiler to create a runnable program.

In my opinion, the most important single aspect here is replicating the original SmallBasic library (smallbasic.dll). Most of the code written in SmallBasic relies on using the classes and methods in that library. By creating a copy of this library, I save a significant amount of coding when it comes to the interpreter itself, as the classes and methods already present in the library don’t need to be handled further. Adding, modifying, or removing classes and methods is relatively easy for anyone with proficient knowledge of C#.

The project does not depend on the "Primitive" type variables found in the original SmallBasic. The same outcome is achieved in C# using the "dynamic" type, which allows the type of content in a variable to change on the fly. My project allows this, but it does not force the user to take full advantage of C#'s type system.

I still need to do a bit more polishing on the library I’ve released now, but I don’t think it will take too much longer. Then I can focus on the interpreter that translates SmallBasic code to C#. Initially, I made the mistake of trying to work on both at once, and that’s why the interpreter is still in a very rough state and not ready for release even as early beta.

Once I get the whole package together, expanding it will be much easier. If something is possible in C#, then adding it to my project will also be possible.

As for variable naming, I knew I’d be stirring up a hornet’s nest—some might even call it “witchcraft.” Big Grin

This hasn’t been set in stone yet. Whether the interpreter requires a "$" suffix for variable names or not is ultimately a minor adjustment. However, in my opinion, distinguishing variables with a "$" suffix makes the code more readable and less prone to guesswork. But as I said, this isn’t set in stone yet.
[-] The following 2 users Like KristianVirtanen's post:
  • AbsoluteBeginner, litdev
Reply


Messages In This Thread
SmallBasic Open Edition - by KristianVirtanen - 10-13-2024, 04:41 PM
RE: SmallBasic Open Edition - by KristianVirtanen - 10-13-2024, 08:55 PM
RE: SmallBasic Open Edition - by litdev - 10-14-2024, 08:35 AM
RE: SmallBasic Open Edition - by z-s - 10-14-2024, 09:02 AM
RE: SmallBasic Open Edition - by KristianVirtanen - 10-14-2024, 10:59 AM
RE: SmallBasic Open Edition - by z-s - 10-14-2024, 04:39 PM
RE: SmallBasic Open Edition - by KristianVirtanen - 10-14-2024, 05:57 PM
RE: SmallBasic Open Edition - by Scout - 10-15-2024, 09:11 AM
RE: SmallBasic Open Edition - by litdev - 10-15-2024, 12:46 PM
RE: SmallBasic Open Edition - by Scout - 10-15-2024, 03:44 PM
RE: SmallBasic Open Edition - by KristianVirtanen - 10-15-2024, 07:27 PM
RE: SmallBasic Open Edition - by KristianVirtanen - 10-18-2024, 08:41 AM
RE: SmallBasic Open Edition - by litdev - 10-18-2024, 12:21 PM
RE: SmallBasic Open Edition - by jrmrhrb00 - 10-18-2024, 03:52 PM
RE: SmallBasic Open Edition - by KristianVirtanen - 10-18-2024, 08:13 PM
RE: SmallBasic Open Edition - by z-s - 10-19-2024, 02:28 AM
RE: SmallBasic Open Edition - by litdev - 10-19-2024, 10:49 AM
RE: SmallBasic Open Edition - by KristianVirtanen - 10-19-2024, 12:53 PM
RE: SmallBasic Open Edition - by z-s - 10-19-2024, 03:47 PM
RE: SmallBasic Open Edition - by KristianVirtanen - 10-20-2024, 08:59 AM
RE: SmallBasic Open Edition - by KristianVirtanen - 10-25-2024, 08:54 PM
RE: SmallBasic Open Edition - by KristianVirtanen - 11-05-2024, 06:37 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)