Author Topic: "New" BASIC (based on MUSL)  (Read 3627 times)

Cybermonkey

  • Administrator
  • *****
  • Posts: 0
"New" BASIC (based on MUSL)
« on: May 11, 2019, 01:47:17 PM »
A few days ago I came across the MUSL (My Unstructured Scripting Language) interpreter. (https://github.com/wernsey/musl) It is a a small, embeddable BASIC interpreter in C. And it's freaking awesome because it's totally old school. Don't get me wrong, I also like  my-basic from Wang but it's growing too fat IMHO and becoming too "modern".
So I just started adding a few functions which are namely ink, paper, cls and locate (based on a Linux conio lib). Yes, it's Linux and console only at the moment.
Oh, btw you can (but need not) use line numbers in your BASIC script.
Classic "Hello World" example:
Code: [Select]
CLS
INK 11
LOCATE 25,2
PRINT "Cybermonkey presents:"
FOR i=0 TO 15 DO
INK i
PAPER 15-i
PRINT "Hello World!"
NEXT

One thing to notice is that the FOR loop looks a bit as if derived from Pascal. Anyway if you won't compile it from source, I attach a Linux x64 binary with the examples and my added functions.

Oh, I forgot to mention that MUSL is also used in the awesome microme project:
« Last Edit: May 11, 2019, 02:26:00 PM by Cybermonkey »

Tomaaz

  • Guest
« Last Edit: May 11, 2019, 04:58:27 PM by Tomaaz »

Aurel

  • Guest
Re: "New" BASIC (based on MUSL)
« Reply #2 on: May 11, 2019, 05:55:47 PM »
Quote
I also like  my-basic from Wang but it's growing too fat IMHO and becoming too "modern".

Yes Cyb ..i agree.
Old ..first version of Wang is minimal...
also "modern" ..it is still just console interpreter, right?

Cybermonkey

  • Administrator
  • *****
  • Posts: 0
Re: "New" BASIC (based on MUSL)
« Reply #3 on: May 11, 2019, 06:26:18 PM »
Quote
I also like  my-basic from Wang but it's growing too fat IMHO and becoming too "modern".

Yes Cyb ..i agree.
Old ..first version of Wang is minimal...
also "modern" ..it is still just console interpreter, right?
Yes, with "modern" I mean things like OOP and lambda etc.

Tomaaz

  • Guest
Re: "New" BASIC (based on MUSL)
« Reply #4 on: May 11, 2019, 09:04:16 PM »
Yes, with "modern" I mean things like OOP and lambda etc.

Lambda? It's very important in Lisp and Lisp is one of the oldest languages.

Cybermonkey

  • Administrator
  • *****
  • Posts: 0
Re: "New" BASIC (based on MUSL)
« Reply #5 on: May 12, 2019, 08:28:01 AM »
Yes, with "modern" I mean things like OOP and lambda etc.

Lambda? It's very important in Lisp and Lisp is one of the oldest languages.
Yes, okay. But it was never important in BASIC, was it?  ;) (I refer to the first generation, unstructured BASIC which this one is/will be.)

Cybermonkey

  • Administrator
  • *****
  • Posts: 0
Re: "New" BASIC (based on MUSL)
« Reply #6 on: May 12, 2019, 12:35:57 PM »
Anyway, back to topic. I implemented a few graphics function, so the following program can now be executed (ported from microME) - new version attached:
Code: [Select]
2 INITWINDOW (640,480)
5 SCNCLR
10 xmin=-8601
20 xmax=2867
30 ymin=-4915
40 ymax=4915
50 maxiter=64
60 dx=(xmax-xmin)/200
70 dy=(ymax-ymin)/200
80 cy=ymax : yp=0
90 cx=xmin : xp=0
100 iter = 0 : x=0 : y=0 : x2=0 : y2=0
110 y=((x*y)/2048)+cy
120 x=x2-y2+cx
130 x2=(x*x) / 4096
140 y2=(y*y) / 4096
150 if x2 + y2 > 16384 then goto 180
160 iter = iter + 1
170 if iter < maxiter then goto 110
180 VGACOLOR iter: FILLBOX (xp,yp,xp+3,yp+2)
200 cx = cx + dx : xp = xp + 3
210 if cx < xmax then goto 100
220 cy = cy - dy : yp = yp + 2
230 if cy > ymin then goto 90
240 test=GETKEY()
250 IF test=0 THEN GOTO 240

Yes, another mandelbrot ... and it's now named XBGI BASIC ... (just because I am using the XBGI library)

« Last Edit: May 12, 2019, 12:41:00 PM by Cybermonkey »

Tomaaz

  • Guest
Re: "New" BASIC (based on MUSL)
« Reply #7 on: May 13, 2019, 07:41:56 PM »
I can't see this thing becoming the most popular BASIC. Neither I can see it making to the top ten (or the top hundread). It's not even interesting from any point of view. Let's be honest - it's another garbage. I don't get it. Usually, developpers start from something poor and then make it better and better. You started from something good (EGSL) and then it was a race to the bottom. Sorry, for harsh words, but I'm just being honest. Why couldn't you stick with EGSL?  :(

Aurel

  • Guest
Re: "New" BASIC (based on MUSL)
« Reply #8 on: May 13, 2019, 09:27:59 PM »
Well ..this one is written in C.
EGSL is in Pascal(object Pascal- Lazarus ?) or something similar ....right Cyb

..also original author have another one tcl like - Fiz  ???

Cybermonkey

  • Administrator
  • *****
  • Posts: 0
Re: "New" BASIC (based on MUSL)
« Reply #9 on: May 14, 2019, 07:51:12 AM »
I can't see this thing becoming the most popular BASIC. Neither I can see it making to the top ten (or the top hundread). It's not even interesting from any point of view. Let's be honest - it's another garbage. I don't get it. Usually, developpers start from something poor and then make it better and better. You started from something good (EGSL) and then it was a race to the bottom. Sorry, for harsh words, but I'm just being honest. Why couldn't you stick with EGSL?  :(
Well, I know that it is not becoming popular. But I don't care - I make this for me, myself and I and just for fun. Use it or use it not, it's your choice. You don't have to pay for it, do you?
EGSL uses SDL 1.2 which is obsolete, so because of that it's not developed anymore.

EDIT: Since no one is interested I locked this thread (as a precaution against trolling/hijacking).


« Last Edit: May 14, 2019, 10:26:24 AM by Cybermonkey »