QB64 Phoenix Edition
The L-BASIC compiler - Printable Version

+- QB64 Phoenix Edition (https://qb64phoenix.com/forum)
+-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1)
+--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3)
+---- Forum: Works in Progress (https://qb64phoenix.com/forum/forumdisplay.php?fid=9)
+---- Thread: The L-BASIC compiler (/showthread.php?tid=1369)

Pages: 1 2 3


RE: The L-BASIC compiler - SpriggsySpriggs - 01-10-2023

(01-06-2023, 10:24 PM)cage Wrote: Why would even say something like that.  You think that just because you use a closed source, one size fits all OS that you have the right to belittle someone who has taken the time to make a contribution to FreeBasic, just because he uses Linux!

@cage

I don't think KernelPanic was trying to be rude in his reply. English is not his first language. The wording of your post does come off as quite rude.


RE: The L-BASIC compiler - Jack - 05-20-2024

@luke
I followed the instructions in the readme but I get this message from the msys2 shell
Quote:make: Leaving directory '/home/Admin/L-BASIC/tools'
make: Entering directory '/home/Admin/L-BASIC/compiler'
make: *** No rule to make target '/home/Admin/L-BASIC/tools/tsgen.tool', needed by 'parser/ts_data.bi'.  Stop.
make: Leaving directory '/home/Admin/L-BASIC/compiler'
the tools directory contains the following executables: ffigen.tool.tool.exe, incmerge.tool.tool.exe, tokgen.tool.tool.exe and tsgen.tool.tool.exe


RE: The L-BASIC compiler - luke - 05-21-2024

Hi Jack

Unfortunately the code on the master branch is rather broken at the moment, and Windows support doubly so (I develop on Linux, and only check Windows compilations every so often). I simply wasn't expecting anyone to actually try build it after all this time of being quiet - but I'm flattered that you took the time to do so!

You could probably get it to proceed if you renamed those .exes to get rid of the repeated ".tool", but even then you'll only be able to build the most trivial of programs as floating-point -> integer conversions are currently broken on Windows, likely among other things.

I expect I will be making a followup post in the next few weeks once array support is complete and I am able to resolve issues between the two platforms.

Thanks for your interest in a depressingly slow-moving project.


RE: The L-BASIC compiler - Jack - 05-21-2024

thank you luke Smile 
I am looking forward to your next release


RE: The L-BASIC compiler - Jack - 05-21-2024

luke
removing the extraneous .tool from the executables names in the tool directory allowed me to build L-Basic Smile


RE: The L-BASIC compiler - Jack - 05-21-2024

hello luke
you said that L-Basic is broken, nonetheless I would like to report my findings
the following works
Code: (Select All)
dim as integer i
dim as integer x

x=13
i=10*(x+1)
print i

but not this
Code: (Select All)
dim as integer i
dim as integer x

x=13
i=10*(10*(x+1))
print i
Quote:Both operands to a binary operator are not of the same type!
  %mul2 = mul i32 10, i16 %mul
LLVM ERROR: Broken function found, compilation aborted!
Compilation failed.
array in user defined functions are not supported and the printing of double is in fixed format
however, I got the following to work
Code: (Select All)
dim as integer i

for i=1 to 18
    print i, gamma(i)
next

function gamma#(byval x as double) 'as double
    dim as double a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, f, y, z
    dim as double a11, a12, a13, a14, a15, a16, a17, a18, a19, a20
    a1 =  0.9999999999999999
    a2 =  0.08333333333338228
    a3 =  0.003472222216158396
    a4 = -0.002681326870868177
    a5 = -0.0002294790668608988
    a6 =  0.0007841331256329749
    a7 =  6.903992060449035e-05
    a8 = -0.0005907032612269776
    a9 = -2.877475047743023e-05
    a10 =  0.0005566293593820988
    a11 =  0.001799738210158344
    a12 = -0.008767670094590723
    a13 =  0.01817828637250317
    a14 = -0.02452583787937907
    a15 =  0.02361068245082701
    a16 = -0.01654210549755366
    a17 =  0.008304315532029655
    a18 = -0.00284326571576103
    a19 =  0.0005961678245858015
    a20 = -5.783378931872318e-05

    z=2.506628274631001*x^(x-.5)/(2.718281828459045^x) ' *exp(-x)
    f=x*x : f=f*f : f=f*f*x : f=f*f*x 'f = x^19
    y=x*a1+a2
    y=a3+y*x
    y=a4+y*x
    y=a5+y*x
    y=a6+y*x
    y=a7+y*x
    y=a8+y*x
    y=a9+y*x
    y=a10+y*x
    y=a11+y*x
    y=a12+y*x
    y=a13+y*x
    y=a14+y*x
    y=a15+y*x
    y=a16+y*x
    y=a17+y*x
    y=a18+y*x
    y=a19+y*x
    y=z*(a20+y*x)/f

    gamma=y
end function

the exp function is not supported but you can use e^x instead


RE: The L-BASIC compiler - luke - 05-22-2024

Thanks for the bug report. The multiplication issue was a half-hearted attempt to fix the overflow issues QB64 shows when multiplying large numbers (e.g. PRINT 100000000 * 100000000 gives 1874919424). For now I've "fixed" it to give the same wrong answer as QB64, but I think in the future lbasic should be checking for Overflow by default like QBasic did.