Author Topic: A new scripting language for Linux  (Read 10739 times)

0 Members and 1 Guest are viewing this topic.

Offline Juju

  • Incredibly sexy mare
  • Coder Of Tomorrow
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 5730
  • Rating: +500/-19
  • Weird programmer
    • View Profile
    • juju2143's shed
A new scripting language for Linux
« on: January 11, 2014, 02:57:34 am »
So I felt like practicing my C/C++ skills, and I thought, why not writing a programming language? So that's what I did. This one will be heavily based on the TI-BASIC and Axe syntax, but instead of emulating a 96x64 monochrome screen, it'll just output stuff to stdout like nearly every scripting language out there, like Python and Lua. That is, I don't intend fully emulating the TI-83+, but rather adapt it to the Linux operating system.

Right now, it's barely working, not much is implemented outside of numbers, strings, A-Z, Str0-9, Ans, ->, Disp, Input and the fact : behaves like \n.

You can download and compile it here: https://github.com/juju2143/tibasic

It should work for Linux and Mac OS X. For you Windows guys, you can try Cygwin.

And if you like, I'll just throw a bonus in, that is, 2 languages for the price of one!
« Last Edit: January 11, 2014, 03:01:26 am by Juju »

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?
THEGAME
This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: A new scripting language for Linux
« Reply #1 on: January 11, 2014, 05:39:05 am »
Wha, that looks pretty interesting!
Are you planning on also adding some way to communicate with X?

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline blue_bear_94

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 801
  • Rating: +25/-35
  • Touhou Enthusiast / Former Troll / 68k Programmer
    • View Profile
Re: A new scripting language for Linux
« Reply #2 on: January 11, 2014, 12:19:55 pm »
What kind of changes did you have to make?
Due to dissatisfaction, I will be inactive on Omnimaga until further notice. (?? THP hasn't been much success and there's also the CE. I might possibly be here for a while.)
If you want to implore me to come back, or otherwise contact me, I can be found on GitHub (bluebear94), Twitter (@melranosF_), Reddit (/u/Fluffy8x), or e-mail (if you know my address). As a last resort, send me a PM on Cemetech (bluebear94) or join Touhou Prono (don't be fooled by the name). I've also enabled notifications for PMs on Omnimaga, but I don't advise using that since I might be banned.
Elvyna (Sunrise) 4 5%
TI-84+SE User (2.30 2.55 MP 2.43)
TI-89 Titanium User (3.10)
Casio Prizm User? (1.02)
Bag  東方ぷろの

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: A new scripting language for Linux
« Reply #3 on: January 11, 2014, 02:52:55 pm »
Seems pretty interesting. Will Axe's pt-on do 16x16 sprites with colors?

Also, will double-buffering be supported like in Axe? It's always useful to prevent flickering.

Offline Juju

  • Incredibly sexy mare
  • Coder Of Tomorrow
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 5730
  • Rating: +500/-19
  • Weird programmer
    • View Profile
    • juju2143's shed
Re: A new scripting language for Linux
« Reply #4 on: January 11, 2014, 06:37:35 pm »
There is a graphic library planned (probably kinda like Axe CSE if there was one). It will probably use SDL and use a command to invoke a window.

It'll kinda be the same concept as on the calc with the home screen and the graph screen, the home screen uses command line and if you switch to the graph screen it'll open a graphic window. But, unlike the calc, the window isn't always available.

And of course it will support double buffering.
« Last Edit: January 11, 2014, 06:42:27 pm by Juju »

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?
THEGAME
This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: A new scripting language for Linux
« Reply #5 on: January 11, 2014, 06:38:48 pm »
Yay, are you also planning on doing stuff like buttons, scrollboxes, input boxes etc?

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Juju

  • Incredibly sexy mare
  • Coder Of Tomorrow
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 5730
  • Rating: +500/-19
  • Weird programmer
    • View Profile
    • juju2143's shed
Re: A new scripting language for Linux
« Reply #6 on: January 11, 2014, 06:44:22 pm »
Yay, are you also planning on doing stuff like buttons, scrollboxes, input boxes etc?
Probably not. You might have to do it yourself with mouse/keyboard input. (getKey/getMouse?)

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?
THEGAME
This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: A new scripting language for Linux
« Reply #7 on: January 11, 2014, 06:51:15 pm »
ah, ok

Also, alpha channel :3

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline blue_bear_94

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 801
  • Rating: +25/-35
  • Touhou Enthusiast / Former Troll / 68k Programmer
    • View Profile
Re: A new scripting language for Linux
« Reply #8 on: January 11, 2014, 07:12:54 pm »
What bothered me in TI-Basic was the limited number of variables. Any plans to increase the limit? (Maybe all numerical variables start with a capital letter, and can be followed by lowercase letters?)
Due to dissatisfaction, I will be inactive on Omnimaga until further notice. (?? THP hasn't been much success and there's also the CE. I might possibly be here for a while.)
If you want to implore me to come back, or otherwise contact me, I can be found on GitHub (bluebear94), Twitter (@melranosF_), Reddit (/u/Fluffy8x), or e-mail (if you know my address). As a last resort, send me a PM on Cemetech (bluebear94) or join Touhou Prono (don't be fooled by the name). I've also enabled notifications for PMs on Omnimaga, but I don't advise using that since I might be banned.
Elvyna (Sunrise) 4 5%
TI-84+SE User (2.30 2.55 MP 2.43)
TI-89 Titanium User (3.10)
Casio Prizm User? (1.02)
Bag  東方ぷろの

Offline Lunar Fire

  • LV3 Member (Next: 100)
  • ***
  • Posts: 66
  • Rating: +7/-1
  • I'll be watching you from the shadows
    • View Profile
    • My Tumblr
Re: A new scripting language for Linux
« Reply #9 on: January 12, 2014, 12:42:00 am »
I cloned your repository, typed make, got an error.
I am running a 64-bit Lubuntu 13.10 Virtual Machine on a 64-bit Windows 7 Ultimate host.

I can give you more info if you need to, but this does not even seem to be related to the hardware configuration I have.

Code: [Select]
tommy@Rainbow-VM:~/Documents/tibasic$ make
bison -d tibasic.y
flex tibasic.l
tibasic.l:16: unrecognized rule
tibasic.l:16: unrecognized rule
tibasic.l:16: unrecognized rule
make: *** [lex.yy.c] Error 1

---

Wha, that looks pretty interesting!
Are you planning on also adding some way to communicate with X?

Communicating with X between multiple instances of a program will require the use of Unix sockets. I could dig in JuJu's code and try to add this functionality, as it will be required to emulate communication between 2 TI calculators. Of course it would require some kind of mechanism to emulation connection and disconnection between the two endpoints, which has to be thought out a bit.

So yes, it is possible but not that simple to implement.
« Last Edit: January 12, 2014, 12:49:03 am by LunarFire »
Your drill is the drill that will pierce the heavens!

Offline Juju

  • Incredibly sexy mare
  • Coder Of Tomorrow
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 5730
  • Rating: +500/-19
  • Weird programmer
    • View Profile
    • juju2143's shed
Re: A new scripting language for Linux
« Reply #10 on: January 12, 2014, 12:46:19 am »
Welp, you're right. I'll check it out.

EDIT: Fixed. Accidental stray character caused it to not compile.
« Last Edit: January 12, 2014, 12:51:47 am by Juju »

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?
THEGAME
This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.

Offline Lunar Fire

  • LV3 Member (Next: 100)
  • ***
  • Posts: 66
  • Rating: +7/-1
  • I'll be watching you from the shadows
    • View Profile
    • My Tumblr
Re: A new scripting language for Linux
« Reply #11 on: January 12, 2014, 01:00:05 am »
That bug is the bane of all programmers. It's been a while since I coded anything in C or C++, but that annoying bug did get me everytime.

It has compiled just fine now. Thanks for the quick response.

EDIT: I modified my BrainPuff page to include a link to your github project page, since I noticed you were asking for it but I did not link back to you yet.
« Last Edit: January 12, 2014, 05:32:20 pm by LunarFire »
Your drill is the drill that will pierce the heavens!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: A new scripting language for Linux
« Reply #12 on: January 12, 2014, 01:08:31 am »
That is nothing. Try the HP Prime whitespace bug. I forgot what caused it, but since HP Prime program code is stored in unicode format (UTF-16 I think?), there is more than one character that looks like a space, and copy/pasting code from forums to the connectivity kit or the emulator sometimes cause that code to not compile (Syntax error), even if the code is fine. Often, it's due to wrong whitespaces getting inserted into the code (usually at the end) and a bug in the HP Prime emulator causes error when compiling programs with those spaces. It can be very hard to solve, since they're hard to notice >.<
« Last Edit: January 12, 2014, 01:08:57 am by DJ Omnimaga »

Offline Juju

  • Incredibly sexy mare
  • Coder Of Tomorrow
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 5730
  • Rating: +500/-19
  • Weird programmer
    • View Profile
    • juju2143's shed
Re: A new scripting language for Linux
« Reply #13 on: January 17, 2014, 08:35:55 pm »
UPDATE 6126bb7

- "string->Str1 now works
- File extension is optional (./tibasic prgmA)
- prgm[A-Z][A-Z0-9]{0,7} includes works (save a file as prgmA.tib)

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?
THEGAME
This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: A new scripting language for Linux
« Reply #14 on: January 18, 2014, 12:21:53 am »
I am really curious if some classic BASIC games will run fine even with no modifications? I remember once I made an Axe program that almost ran identically with no change (except inverted X coordinates).