Lasic Alpha Happy New Year Preview

Developed or developing a new product in PureBasic? Tell the world about it.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Lasic Alpha Happy New Year Preview

Post by Trond »

We are still waiting for PB 4 and a few hours ago when I gave up the hope that there would a happy new year surprise I decided I should make SUBs in my own language and release a test version. While the cat is away and so on... :twisted:

But it's limited how good SUBs you can implement in one and a half hour, so don't expect too much! It doesn't actually create executables yet, only assembly code that is ready to be assembled into an object file that is ready to be linked. Fasm and the gnu linker are supplied together with the absolutely necessary for link file kernel32.lib.

It features a more or less fancy ide which you have to use unless you like to type one-liners. The ide is located in the folder called ... ide!

You will be disappointed to know that there is no ouput function yet. (For output of variables)

The syntax is loosely BASIC as you can see from the example files, however there are some exceptions like: The global variables are valid inside subs unless a local variable shadows it (and there aren't any local variables, not even parameters, as of yet).

The generated assembly code is copied to the clipboard.

Download: http://iseip.home.online.no/c6.zip

Please report any bugs with the generated assembly code, lack of error messages or hard to understand error messages.

Two pages are missing in the ide's preferences, this is known.
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Post by rsts »

looks nice so far.

I think I'll wait for the version where Fangles adds a sqlite database :)

cheers
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4790
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Post by Fangbeast »

rsts wrote:looks nice so far.

I think I'll wait for the version where Fangles adds a sqlite database :)

cheers
What on earth are you talking about??? rsts, you are my sort of crazy, welcome to the family:)
Amateur Radio/VK3HAF, (D-STAR/DMR and more), Arduino, ESP32, Coding, Crochet
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Post by va!n »

@Trond:
First a happy new year to you... nice work... btw, this causes a small error...

Code: Select all

DIM a AS INTEGER                   
a = -6*2
 
cl_1:                           ; <-- Error
 
IF a = -12
  a = 13
ELSE
  a = 3
ENDIF

Code: Select all

DIM a AS INTEGER

a = -6*2

IF a = -12 AND b = 2         ; <-- Error because variable b isnt init...
  a = 13
ELSE
  a = 3
ENDIF

DIM a AS INTEGER <-- Btw, i like this way to define the type
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

va!n wrote:@Trond:
First a happy new year to you... nice work... btw, this causes a small error...

Code: Select all

DIM a AS INTEGER                   
a = -6*2
 
cl_1:                           ; <-- Error
 
IF a = -12
  a = 13
ELSE
  a = 3
ENDIF

Code: Select all

DIM a AS INTEGER

a = -6*2

IF a = -12 AND b = 2         ; <-- Error because variable b isnt init...
  a = 13
ELSE
  a = 3
ENDIF

DIM a AS INTEGER <-- Btw, i like this way to define the type
Labels aren't implemented yet (as you saw) and declaration of variables is required.
va!n
Addict
Addict
Posts: 1104
Joined: Wed Apr 20, 2005 12:48 pm

Post by va!n »

ok, i wanted just help by reporting some points... even if its a alpha... keep on your work! i believe it could be a very nice one!
va!n aka Thorsten

Intel i7-980X Extreme Edition, 12 GB DDR3, Radeon 5870 2GB, Windows7 x64,
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

Everyone, please PM me if you are interested in testing a rewritten version before the next release. (You need to know at least some asm.) The generated code is much better now (often beats PB) and there are three (3) more types, including floats.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

New test release. It now generates executables and has output functions so you can check the result of computations without knowing asm. (DebugL for ints and DebugF for floats.) It also includes a small speed test which calculates fibonacci numbers.

Download: http://home.no.net/tsg1zzn/c12.zip
Forum: http://lasic.frac.dk/forum/
remi_meier
Enthusiast
Enthusiast
Posts: 468
Joined: Sat Dec 20, 2003 6:19 pm
Location: Switzerland

Post by remi_meier »

Now this is impressive!
:!:
Athlon64 3700+, 1024MB Ram, Radeon X1600
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

Thanks!

(And just a little hint: The redirection code at http://www.recursivemess.ch.vu/ doesn't work in Opera.)
remi_meier
Enthusiast
Enthusiast
Posts: 468
Joined: Sat Dec 20, 2003 6:19 pm
Location: Switzerland

Post by remi_meier »

Heh, cool, worked before. I sent a bug report to Opera :)
Athlon64 3700+, 1024MB Ram, Radeon X1600
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

I implemented local variables.
Download: http://home.no.net/tsg1zzn/c13.zip
Forum: http://lasic.frac.dk/forum/
Killswitch
Enthusiast
Enthusiast
Posts: 731
Joined: Wed Apr 21, 2004 7:12 pm

Post by Killswitch »

Nice work!
~I see one problem with your reasoning: the fact is thats not a chicken~
Post Reply