01-07-2023, 04:01 PM
(This post was last modified: 01-07-2023, 04:12 PM by Kernelpanic.)
(01-07-2023, 02:27 AM)luke Wrote: However it's an opportunity to experiment with a different architecture, both in terms of the compiler itself and the runtime libraries. The underlying machine code generator (llvm) has support for Just-In-Time compilation, which I expect to be able to use to add an interactive interpreter mode while reusing most of the parsing and runtime code. It is also possible to target webassembly, which opens interesting possibilities for compiling programs to run in the browser.
Also an lbasic hello world program is only 76KB and runs instantly, so I'm pretty happy with that
Thanks for the answer. Yes, that's right, one learn from experimenting like this; I did that too when I started with Basic & Co. Ok!
I put "lbasic" in the path and tried it with arrays, there are problems; see messages. Maybe it helps.
Code: (Select All)
Rem Luke-Basic, 7. Jan. 2023
Dim As Integer zahlenFeld(5, 5)
Dim As Integer a, i, j, z
Dim As Integer zeile, spalte
Locate 2, 2
z = 1
For i = 1 To 5
For j = 1 To 5
zahlenFeld(i, j) = z
Print Using "## "; zahlenFeld(i, j), '"Using" Fehler!
z = z + 1
Next
Print: Locate , 2
Next
End
'-----------------------------------------------------------
z = 1
For i = 1 To 5 'Zeile 11 Fehler!
For j = 1 To 5
zahlenFeld(i, j) = z
Print "## "; zahlenFeld(i, j),
z = z + 1
Next
Print: Locate , 2
Next
Here is the mistake message: For i = 1 To 5 'Zeile 11 Fehler!
PS D:\Lab\Lukebasic> lbasic LFeld.bas
codegen: bad ll type: INTEGER[2]
Code: (Select All)
Rem Luke-Basic, 7. Jan. 2023
Dim As Integer zahlenFeld(5, 5)
Dim As Integer a, i, j, z
Dim As Integer zeile, spalte
Locate 2, 2
z = 1
For i = 1 To 5 'Zeile 11 Fehler!
For j = 1 To 5
zahlenFeld(i, j) = z
Print "## "; zahlenFeld(i, j),
z = z + 1
Next
Print: Locate , 2
Next
End
There is also an error message that I don't understand: 18 is Print(?) Error with or without "Print". In QB64 it works.
Code: (Select All)
Option _Explicit
Dim PS As Double, KW As Double
Dim Auswahl As Integer
Print "1 -- PS in Kilowatt"
Print "2 -- Kilowatt in PS"
Print
Input "Ihre Wahl: ", Auswahl
Print
If Auswahl = 1 Then
Input "Anzahl PS: ", PS
KW = PS / 1.36
Print -- Fehler?
Print KW
Else
Input "Anzahl Kilowatt: ", KW
PS = KW * 1.36
Print
Print PS
End If
End