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

Cybermonkey

  • Administrator
  • Hero Member
  • *****
  • Posts: 671
    • View Profile
    • Home of EGSL
"New" BASIC (based on MUSL)
« on: 11. May 2019, 15:47:17 »
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: 11. May 2019, 16:26:00 by Cybermonkey »
Best regards,
Cybermonkey

Tomaaz

  • Guest
« Last Edit: 11. May 2019, 18:58:27 by Tomaaz »

Aurel

  • Regular Member
  • Hero Member
  • *
  • Posts: 596
    • View Profile
Re: "New" BASIC (based on MUSL)
« Reply #2 on: 11. May 2019, 19:55:47 »
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?
** NOT RESPOND - HIGH RISK **************
http://basicpro.mipropia.com/smf/index.php
**************************************
USE:
http://basicpro.spacefor.site/smf/index.php

Cybermonkey

  • Administrator
  • Hero Member
  • *****
  • Posts: 671
    • View Profile
    • Home of EGSL
Re: "New" BASIC (based on MUSL)
« Reply #3 on: 11. May 2019, 20:26:18 »
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.
Best regards,
Cybermonkey

Tomaaz

  • Guest
Re: "New" BASIC (based on MUSL)
« Reply #4 on: 11. May 2019, 23:04:16 »
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
  • Hero Member
  • *****
  • Posts: 671
    • View Profile
    • Home of EGSL
Re: "New" BASIC (based on MUSL)
« Reply #5 on: 12. May 2019, 10:28:01 »
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.)
Best regards,
Cybermonkey

Cybermonkey

  • Administrator
  • Hero Member
  • *****
  • Posts: 671
    • View Profile
    • Home of EGSL
Re: "New" BASIC (based on MUSL)
« Reply #6 on: 12. May 2019, 14:35:57 »
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: 12. May 2019, 14:41:00 by Cybermonkey »
Best regards,
Cybermonkey

Tomaaz

  • Guest
Re: "New" BASIC (based on MUSL)
« Reply #7 on: 13. May 2019, 21:41:56 »
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

  • Regular Member
  • Hero Member
  • *
  • Posts: 596
    • View Profile
Re: "New" BASIC (based on MUSL)
« Reply #8 on: 13. May 2019, 23:27:59 »
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  ???
** NOT RESPOND - HIGH RISK **************
http://basicpro.mipropia.com/smf/index.php
**************************************
USE:
http://basicpro.spacefor.site/smf/index.php

Cybermonkey

  • Administrator
  • Hero Member
  • *****
  • Posts: 671
    • View Profile
    • Home of EGSL
Re: "New" BASIC (based on MUSL)
« Reply #9 on: 14. May 2019, 09:51:12 »
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: 14. May 2019, 12:26:24 by Cybermonkey »
Best regards,
Cybermonkey