Text
AFOS BASIC design talk
In BASIC when you press enter, it usually denotes the end of a code statement. What that means is that the interpreter can take what you just typed and convert it into tokens and execute it on the fly.
That is fine and dandy for small one line expressions but what about complex constructs like loops and functions. Its hard to go back and edit mistakes. The original BASIC was designed to work with line numbers. We had the ability to overwrite line numbers to fix mistakes. Things have changed since then. Line numbers are obsolete. FreeBASIC is a compiler and its not interactive. Hence they didn't have to worry about that stuff. Personally, I do like the ability to do interactive development. What Microsoft did in Q'BASIC is, they had a text editor on top and an interactive command prompt at the bottom. Q'BASIC does allow complex statements on the command prompt but I don't like it.
I am thinking of only allowing a subset of the language to be interpreted interactively. For example no loops, no case select statements, no functions, etc. Code containing complex statements can be saved on a text file separately and loaded on the console.
Also, modern languages like to use a semicolon to denote the end of a code statement. I prefer the semicolon over the carriage return as a delimiter because of long statements. Sometimes to make the code prettier I want to break down a long statement into multiple lines. I can do this the semicolon but not with the carriage return.
So this is what is going to happen. I will use the semicolon as the delimiter. In the interactive console the semicolon will be optional and as soon as you press enter that will denote the end of the code statement. Shift + Enter will allow you to span multiple lines. When writing code on a text file. The semicolon will be required.
0 notes
Text
AFOS BASIC - Interpreter style
The first version of AFOS BASIC will be what I call an interpreter masking over JAVA. What I mean by that is that BASIC will be at the surface (what you see) and JAVA will be underneath (doing all the work). The term masking meaning BASIC is just a mask that JAVA is wearing. (note: masking should be a vocabulary word).
In the second version of AFOS BASIC, I will convert all the tokens into byte codes and attempt to develop a virtual machine. The interpreter will not evaluate the syntax tree. Instead it will convert it into byte code and pass it over to the virtual machine to execute it.
0 notes
Text
AFOS BASIC - primitive data types
To start simple I will only adopt four primitive data types.
byte - represented by the byte in JAVA (8bit signed)
integer - represented by the int in JAVA (32bit signed)
float - represented by float in JAVA
string - represented by the string in JAVA
Variable declaration is as follows:
[static] Var [shared] symbolname = expression[, symbolname = expression]
I will try to follow FreeBasic syntax as much as I can. This means datatype is autodetected (as opposed to explicitly declared). FreeBasic uses the Cast keyword to explicitly declare a datatype.
0 notes
Text
Back on track with AFOS BASIC
I tried to avoid AndroidStudio. It is possible to develop apps with just the command line tools. Unfortunately F-Droid is deprecating the old way in favor of gradle. To me it ultimately meant I have to have AndroidStudio installed even if I choose not to use it. I am forced to use it to create new projects because of the gradle scripts and initial file structure.
To jump start AFOS BASIC I resurrected an old project and imported it to use gradle. Eval is a simple interpreter, I developed a while back. I am going to overhaul it to make it into a BASIC interpreter. Eval is a very simple program.
Eval works like a command console or chat box. It uses only two GUI widgets. A TextEdit for input and a ListView for output. Every time you hit enter, the program takes the input, parses it, creates an syntax tree, evaluates the syntax tree and adds the output to the ListView.
Parsing is done thru Recursive Descent.
0 notes
Text
AFOS-BASIC
As of this writing I am commissioning yet another project. An interpreter for the BASIC programming language. AFOS stands for Android Free Open Source.
My goal is to have something to work with in experimenting in language design. It has to be useful yet simple to implement hence the BASIC language fits in nicely.
I am going to make this is a gift to the F-Droid community. They only host one BASIC interpreter. They used to have more but somehow those projects fled or eroded out. I did see several in the play store.
The usefulness of this project:
(1) To have a programmatic access to the Android OS. Ya know, something similar to BASH and Python scripting.
(2) To provide something similar to P5.js or the Processing programming language. The idea there is to play around with the drawing routines available to the browser. Useful for simple data visualization. An example case is an algebra student trying to get visuals to some equations. Plenty of YouTubers use it for their videos.
(3) Allow kids who are curious to learn programming. The same audience Microsoft Small BASIC is targeting. Give them the ability to make simple games.
1 note
·
View note
Text
Regarding the Name and Theme
I want to use the word Savage because when attempting to write a book or engage in a complex project. The thoughts and ideas in my mind are all disorganized and in a state of chaos. The task at hand is an attempt to tame their savageness. Bring order and structure. The term SavageGardens romanizes that notion.
The SavageRoses is a baby version of SavageGardens. The term seems to be more girly but I am ok with it. I believe it will catch the eyes of women in tech. Make them feel more at home. Some women actually identify being cute on the outside but savage underneath.
I can't help to think about it being a conversation starter: "Have you programmed with SavageRoses? Its a real programming language."
I am a traditional guy myself and I don't think men will mind working with SavageRoses. They don't have identify with the term. Just work with the language. Men should appreciate the language for the ideas that it brings forward.
0 notes
Text
About This Blog
SavageGardens is an rather complex project to undertake by myself so I am first making a baby version of it: SavageRoses.
SavageRoses will utilize a simpler ladder of abstraction. Only three layers. At the base will be a variant of BASIC. At the middle CB-Maps for management and up top Executive Widgets.
The goals of SavageRoses is to provide proof of concept and personal R&D into programming language implementation.
0 notes