flat assembler
Message board for the users of flat assembler.

Index > High Level Languages > Bubble BASIC for Linux

Author
Thread Post new topic Reply to topic
cl0ckw0rkz14



Joined: 18 Feb 2014
Posts: 21
cl0ckw0rkz14 18 Feb 2014, 06:39
EDIT: I've removed the file for now, download the latest Windows-compatible version from sourceforge, it's more stable and works on both platforms.

Hi,

This is my little BASIC compiler for Linux. It is free (as in freedom). It's very new and so I expect there are some bugs. I'd really appreciate if Linux users could try it out, write a few sample programs, etc. to help find any bugs.

The installation instructions are in the .html documentation in the tar archive, installing is very simple on Ubuntu.

Thanks


Last edited by cl0ckw0rkz14 on 31 Jul 2014, 21:13; edited 6 times in total
Post 18 Feb 2014, 06:39
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20458
Location: In your JS exploiting you and your system
revolution 18 Feb 2014, 06:52
Moving to HLL forum.
Post 18 Feb 2014, 06:52
View user's profile Send private message Visit poster's website Reply with quote
cl0ckw0rkz14



Joined: 18 Feb 2014
Posts: 21
cl0ckw0rkz14 19 Feb 2014, 22:06
Thanks revolution, I wasn't really sure where it belonged, I nearly posted it under Linux.

So I suppose I should say more about the compiler and its features (I was very sleepy and in a hurry when I made the original post).

* Fully featured BASIC compiler a la 1980s/Commodore 64 era.
* Nearly all familiar BASIC commands supported (PRINT, INPUT, IF... THEN, GOTO, GOSUB, DATA, etc.)
* Lots of BASIC functions supported (SIN, COS, EXP, LOG, string functions such as LEN and MID)
* All the traditional BASIC operators (unary -, NOT, OR, AND, >, >=, <, <=, = [equality operator], +, -, *, /, ^, function(...), = [assignment operator])
* Three intrinsic data types (all 64-bit): Integer, double precision floating point, and UTF-8 string. Arrays of any dimensionality.
* Full Unicode support (UNI function replaces traditional ASC)
* Text file I/O.
* Compiles to native 64-bit asm (can use fasm or nasm as backend).
* Inline asm feature.
* Probably a bunch more stuff I've omitted to mention.

It's intended to be the MikeOS of BASICs I guess (though without comments).

Enjoy.
Post 19 Feb 2014, 22:06
View user's profile Send private message Reply with quote
cl0ckw0rkz14



Joined: 18 Feb 2014
Posts: 21
cl0ckw0rkz14 28 Feb 2014, 03:32
Hi,

Can any of the 21 people who've downloaded this confirm that they were able to install the compiler and compile the example programs? I'd appreciate some feedback. Thanks.
Post 28 Feb 2014, 03:32
View user's profile Send private message Reply with quote
cl0ckw0rkz14



Joined: 18 Feb 2014
Posts: 21
cl0ckw0rkz14 04 Mar 2014, 06:27
Bubble BASIC now has a sourceforge page: http://sourceforge.net/projects/bubblebasic/ where you can see a screenshot of it running on Bodhi Linux.
The latest tarball on there has a couple of bug fixes. Also, my apologies, I've just discovered it has another dependency not listed in the documentation: libgtk-3-dev. The documentation has been fixed in the sourceforge tarball.
Post 04 Mar 2014, 06:27
View user's profile Send private message Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo 12 Mar 2014, 12:18
I halfway intended to look at this, and I did download it, but I never got around to it. Too distracted these days. Also, now seeing that it requires 64-bit may be a problem since my only Linux install is 32-bit (doh, though I guess I could use VBox).

Wait, this is written in Haskell and C ??? (No wonder it was moved to HLL Forum.) Weird, heh. Not bad, per se, just more annoying dependencies. Razz Maybe indeed I'm the worst person to be testing this, but I'm just always curious about these things ....

Well, for what it's worth, this sounds awesome. Cool
Post 12 Mar 2014, 12:18
View user's profile Send private message Visit poster's website Reply with quote
sid123



Joined: 30 Jul 2013
Posts: 339
Location: Asia, Singapore
sid123 12 Mar 2014, 12:49
Bubble BASIC Sourceforge.net page wrote:

*Inline asm feature.

Now THAT is cool. Possibly the first(?) BASIC to have inline asm? Smile
Btw he didn't do anything wrong posting here on FASM board, it does generate FASM/NASM output.
How about a -nostdlib option? Smile
Post 12 Mar 2014, 12:49
View user's profile Send private message Reply with quote
cl0ckw0rkz14



Joined: 18 Feb 2014
Posts: 21
cl0ckw0rkz14 12 Mar 2014, 19:21
Hi,

Thanks for the replies and words of encouragement. I was kinda unnerved by the 40+ downloads and the absolute silence of all the downloaders! rugxulo, yeah, C and Haskell - I don't enjoy pain enough to write something like this in asm (I just checked and it's about 7000 lines of code even in HLL). It would be nice if someone could put the compiler thru its paces, as you can tell from my initial post I was less concerned about promoting my language and more concerned about having missed some catastrophic bug. I know installing a new distro is a pain tho, even in VirtualBox.

sid123, yes inline assembly was a must for me, not least because the compiler produces quite poor/slow code. It's definitely not the first BASIC to support inline asm - PureBASIC is built on fasm and has that feature. Last time I checked though, PureBASIC did not allow you to direct inline asm to the program's data section if necessary, which IMO is a must. Also PB is proprietary - I did wonder if my BASIC was the first "open source" BASIC built on fasm? Tho I vaguely remember someone posting that he wrote a BASIC for MenuetOS so maybe I've missed that boat.

About the --nostdlib option: unfortunately, Bubble BASIC depends on libspiritlevel for almost _everything_ it does. For example, PRINT, INPUT, DATA/READ/RESTORE. Even reading/writing an array requires a library call to calculate a linear offset from a multi-dimensional one. So it would be pretty crippled without the libraries. You couldn't even do arithmetic as the ^ operator relies on the C function "pow". What were you thinking of using the --nostdlib option for? Cross-compiling to a hobby OS? I'm interested.

Anyhow, my main priority is to make sure it's stable before I add any new features.
Thanks again.
Post 12 Mar 2014, 19:21
View user's profile Send private message Reply with quote
cl0ckw0rkz14



Joined: 18 Feb 2014
Posts: 21
cl0ckw0rkz14 27 May 2014, 19:10
Just wanted to say that I've committed a new version of Bubble BASIC to the sourceforge repo which fixes several memory bugs (leaks, invalid frees, etc.) I'll probably make a .tar.gz package at some point but in the meantime you can get the latest version with

Code:
svn checkout https://svn.code.sf.net/p/bubblebasic/code destination
    


(where “destination” is the directory you want to create to hold the source code). Don't download the version in the first post of this thread anymore it was very experimental/broken.
Post 27 May 2014, 19:10
View user's profile Send private message Reply with quote
cl0ckw0rkz14



Joined: 18 Feb 2014
Posts: 21
cl0ckw0rkz14 28 May 2014, 22:07
Update: You can now grab BubbleBASIC-0.1.2.tar.gz directly from the sourceforge site at http://sourceforge.net/projects/bubblebasic/

This version fixes several bugs.
Post 28 May 2014, 22:07
View user's profile Send private message Reply with quote
TmX



Joined: 02 Mar 2006
Posts: 843
Location: Jakarta, Indonesia
TmX 31 May 2014, 15:37
Hi cl0ckw0rkz14,

I learnt Haskell a bit during undergradute study, so I guess it's time to refresh my memory again. Smile
I just installed GHC on my Debian box.

Quote:

root@stalingrad:~/bubblebasic-svn/trunk# make
ghc Main.hs -o bubble-basic -O3

Linker.hs:42:8:
Could not find module `Control.Monad.Identity'
Use -v to see a list of the files searched for.
Makefile:23: recipe for target 'bubble-basic' failed
make: *** [bubble-basic] Error 1


OK. How do I install this Control.Monad.Identity?
I'm not that familiar with Haskell dev environment Confused

update
Installing libghc-mtl-dev solved the problem. But compilation still failed
because I don't have glib installed. Oh well...
Post 31 May 2014, 15:37
View user's profile Send private message Reply with quote
cl0ckw0rkz14



Joined: 18 Feb 2014
Posts: 21
cl0ckw0rkz14 01 Jun 2014, 18:03
Hi TmX Smile

Thanks for your interest. Haskell is an amazing language, for me it seems to model the real world much more authentically than OOP languages like C++ (which claim to).

The file BubbleBASIC.html explains how to install the dependencies but for quick reference

Code:
sudo apt-get install gcc ghc libghc-mtl-dev libglib2.0-dev libgtk-3-dev pkg-config elyxer
    


although obviously the names of the packages may differ according to distro. It seems you're using a Debian-like distro in any case since the package you installed was *-dev and not *-devel as with Fedora.

TBH, BubbleBASIC is new (pre-alpha) and under heavy development and I've found some major bugs over the weekend so you might be better off waiting a few days for the next .tar.gz package. In particular I found a bug that caused an FPU stack overflow, a lot of memory errors, and several problems with user defined functions.

Much of this is fixed in my local copy, I just need to upload it.
Post 01 Jun 2014, 18:03
View user's profile Send private message Reply with quote
cl0ckw0rkz14



Joined: 18 Feb 2014
Posts: 21
cl0ckw0rkz14 02 Jun 2014, 19:11
Hi,

Well I've just uploaded version 0.1.3 which fixes a lot of bugs. It's on the sourceforge site and now also in the first post of this topic. If your BubbleBASIC programs segfaulted last time you tried it, you might want to try with the new version.
Post 02 Jun 2014, 19:11
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 02 Jun 2014, 20:36
I only missed to understand what M$ have to do in the title???
Post 02 Jun 2014, 20:36
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
cl0ckw0rkz14



Joined: 18 Feb 2014
Posts: 21
cl0ckw0rkz14 02 Jun 2014, 21:15
It has a very similar syntax (etc.) to the BASIC that came with the Commodore 64 computer. This BASIC was bought by Commodore from Microsoft. I wasn't trying to suggest that I am affiliated with Microsoft, or trying to profit from their reputation (not that they have much of a reputation any more). It was more of a joke really.

http://en.wikipedia.org/wiki/Commodore_BASIC
Post 02 Jun 2014, 21:15
View user's profile Send private message Reply with quote
cl0ckw0rkz14



Joined: 18 Feb 2014
Posts: 21
cl0ckw0rkz14 06 Jun 2014, 03:31
I just uploaded a new version (0.1.4) to this thread and sourceforge.net, I fixed a bug which caused segfaults when you dimensioned an array with floating point values, and some nasty memory corruption bugs related to user-defined functions.
Post 06 Jun 2014, 03:31
View user's profile Send private message Reply with quote
cl0ckw0rkz14



Joined: 18 Feb 2014
Posts: 21
cl0ckw0rkz14 12 Jun 2014, 05:02
Just finished a lot of bug fixes. I hesitate to say it's stable, but it can now compile a quite long and complicated test program i wrote (which comes out valgrind-perfect).

Most recent changes:

Fixed bug preventing the use of GOTO to jump around inside FOR loops (it caused an assembler error).
Fixed all gcc warnings for libspiritlevel.c (release).
Added helpful CHANGES file.
Fixed bug causing scratch registers to be popped in the same order in which they were pushed, which resulted in crashes/memory corruption etc.
Removed some dead code from compiler module.
Fixed all gcc warnings for libspiritlevel.c (debug).
Post 12 Jun 2014, 05:02
View user's profile Send private message Reply with quote
cl0ckw0rkz14



Joined: 18 Feb 2014
Posts: 21
cl0ckw0rkz14 19 Jun 2014, 03:07
Hi,

Since no-one shared any test code or bug reports, I thought I should write a small-to-medium sized project myself in Bubble BASIC to help find any bugs and improve its stability. LIFE (the "LIFE Interactive Fiction Engine") is a minimal generic script-based framework for creating simple text-based adventure games. The LIFE binary is an interpreter that interprets and executes these games. It comes with a darkly-comic adventure game "None Shall Pass", which pits you against a troll, a demented nun, a crazy occult-obsessed fireman and some creatures known only as "The Dreadful Creatures".

Thanks for downloading this (now hopefully relatively stable) project. Comments/questions/ideas/code/bug reports welcome.
Post 19 Jun 2014, 03:07
View user's profile Send private message Reply with quote
cl0ckw0rkz14



Joined: 18 Feb 2014
Posts: 21
cl0ckw0rkz14 13 Oct 2014, 19:04
Just a quick update. I just uploaded version 0.1.8 to the sourceforge site. This version has binaries for Linux as well as Windows so there's no longer any need to compile from source on either platform (you still can if you want to though, obviously). One thing I just noticed that didn't make it into the documentation is that you may need to run

Code:
chmod +x bubble-basic
chmod +x libspiritlevel.so
    


Before (or after) running the "install-linux.sh" script. In other news the LIFE Interactive Fiction Engine has been removed due to my parish priest confirming to me that no, creepy sinister games where you have to kill nuns aren't really acceptable. So that'll be gone till I get the time to write a more wholesome example game.

Thanks to everyone who's continued to show interest by downloading this project (and thanks to the mystery user who "liked" it on Facebook). Version 0.1.8 fixes several bugs (some of them quite serious). Of course bugs are hard to find when no-one reports any!

http://sourceforge.net/projects/bubblebasic/

Bye for now,
The Clockwork Dev Studio
Post 13 Oct 2014, 19:04
View user's profile Send private message Reply with quote
cl0ckw0rkz14



Joined: 18 Feb 2014
Posts: 21
cl0ckw0rkz14 23 Oct 2014, 19:59
Just uploaded version 0.1.9 which has a minor bug fix (a stack alignment problem with certain function calls). To all the people who downloaded the early buggy versions, please try BubbleBASIC again, you may be pleasantly surprised.
Post 23 Oct 2014, 19:59
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.