BaCon - Bash-based Basic-to-C converter/compiler

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Message
Author
2lss
Posts: 225
Joined: Sun 20 Sep 2009, 23:54

#76 Post by 2lss »

BarryK wrote:The next Wary Puppy, probably version 097, that I expect to release in 2-3 days, has BaCon support all setup and ready to go. See blog announcement:

http://bkhome.org/blog/?viewDetailed=01950

Also, see my BaCon intro page:

http://bkhome.org/bacon/
Thanks Barry, I'm going to give this a try.

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#77 Post by BarryK »

2lss wrote:
BarryK wrote:The next Wary Puppy, probably version 097, that I expect to release in 2-3 days, has BaCon support all setup and ready to go. See blog announcement:

http://bkhome.org/blog/?viewDetailed=01950

Also, see my BaCon intro page:

http://bkhome.org/bacon/
Thanks Barry, I'm going to give this a try.
I have uploaded Wary 097, which has all the bacon goodies in it. I am having a sound problem, which I why I haven't formally announced 097 on my blog, and 098 will be uploaded soon. But 097 should be fine for BaCon development -- and most likely you won't even get the sound problem.

Get 097 from here:
http://distro.ibiblio.org/pub/linux/dis ... /wary-097/
[url]https://bkhome.org/news/[/url]

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#78 Post by BarryK »

Note, I think that some of the .bac include files are broken in Wary 097, /usr/local/BaCon -- I created them by opening the .bac.html files on the BaCon website and saving them as plain text -- but the files have lots of '*' characters everywhere.

Note that Wary 097 has a compiled /usr/bin/bacon compiler, so doesn't need Bash 4.x.
[url]https://bkhome.org/news/[/url]

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#79 Post by Lobster »

Note, I think that some of the .bac include files are broken in Wary 097
:shock:

Downloaded and setup 097 (sound worked on initial boot and then never again - no persistence)

ahem . . .

Downloaded and setup 097

then went to usr/share/BaCon

Code: Select all

# bacon c calculator.bac
Starting conversion... done.   
Starting compilation... done.
Program 'calculator' ready.
I have pork

Code: Select all

# ./calculator 

-= BACON Calculator =-

1) Perform addition
2) Perform substraction
3) Perform multiplication
4) Perform division
5) Quit
Sadly hug.bac, editor.bac
etc are broken as mentioned

Code: Select all

# bacon c glade.bac
Starting conversion... 28   
ERROR: could not parse line 28 in file 'glade.bac'!
# bacon c editor.bac
Starting conversion... done.   
Starting compilation... Compiler emits messages!

Problem:
	 file 'editor.bac' line 227: WRITELN "font ", ptr1 TO settings
Cause:
	 incompatible type for argument 1 of '__b2c__str'
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

User avatar
Ray MK
Posts: 774
Joined: Tue 05 Feb 2008, 09:10
Location: UK

#80 Post by Ray MK »

Hi Barry

Just a note to say Wary 097 seems fine - all the basic's,
from a n00b viewpoint seem to work.

Woof woof at startup ok, nico edit seems fine, using it now.

Wired internet - good. Not tried wifi yet, or dialup.

Had to setup mouse tapping - no prob's.
(051 tapping worked auto-magically)

097 not quite so snappy as 051 -
(guessing thats because of extra drivers etc)

Manual frugal to sda1 ext3, 256mb ram,
Celeron 2.5Ghz proc, 700mb swap partition,
Acer Travelmate 243LC laptop. approx 8yrs old.

Very best regards and many thanks for all you do - Ray

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

Lobster's woes

#81 Post by vovchik »

Dear Lobster,

I am attaching the latest hug.bac and glade.bac as an archive. I know they work fine. Just unpack and replace your old files with these.

With kind regards,
vovchik
Attachments
hug-glade.tar.gz
(12.63 KiB) Downloaded 378 times

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#82 Post by jpeps »

I'm probably doing something wrong, but:

Code: Select all

~/Downloads/bacon/cli-demos $ sudo bacon c mastermind.bac 
Starting conversion... done.   
Applying indentation... sh: indent: command not found
Unable to delete file: No such file or directory
I'm using Lucid 2.3.5, with GNU bash, version 4.1.0(1)-release (i686-pc-linux-gnu).

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

indent binary

#83 Post by vovchik »

Dear jpes,

Looks as if you are missing the indent binary (and who knows what else). In any case, here is the indent binary. Place it in /usr/bin and give it another try.

With kind regards,
vovchik

PS. And just run "bacon mastermind" for compilation of the source.
Attachments
indent.tar.gz
(28.46 KiB) Downloaded 387 times

NinerSevenTango
Posts: 186
Joined: Sun 17 Jun 2007, 18:25

#84 Post by NinerSevenTango »

Who dares to attempt to compile and run the gtk-server demo on the BaCon website?

Or the Glade example calculator.

--97T--

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

gtk server demo

#85 Post by vovchik »

Dear NinerSevenTango,

The program compiles fine and will work if you first install Peter's gtk-server (http://www.gtk-server.org/). Get the latest version and compile it. Make certain your /etc/gtk-server.cfg file corresponds to your version of gtk, otherwise you will have problems. Gtk-server is very picky about correspondences between the config file and the version of gtk you are running.

With kind regards,
vovchik

NinerSevenTango
Posts: 186
Joined: Sun 17 Jun 2007, 18:25

#86 Post by NinerSevenTango »

Thanks, vovchik.

I did download and install the latest version of gtk-server.

This is a full install of Quirky 1.3.

I installed it as a 'shared object', after installing FFCall.

There is no /etc/gtk-server.cfg. I found it at /usr/local/etc/gtk-server.cfg. Should I move it, reinstall with some different options, or add a path variable? Hmmmm.

Edit: The file lists a bunch of libraries. I could find them all except:

libgtkgl-2.0.so, libgtkglext-x11-1.0.so, libgdkglext-x11-1.0.so, libgtkembedmoz.so, libpoppler-glib.so

Now I'm wondering, if the program calling it can actually find it, will it bomb if these libraries are not present?

I appreciate your response, thanks again,

--97T--

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

Re: indent binary

#87 Post by jpeps »

vovchik wrote:Dear jpes,

Looks as if you are missing the indent binary (and who knows what else). In any case, here is the indent binary. Place it in /usr/bin and give it another try.
Thanks vovchik; working now, although "calc.bac" has strange way of adding: 20 + 35 = 2035 :D

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

#88 Post by vovchik »

Dear NinerSevenTango,

I seem to have all the libs you list installed and I also have a the .cfg file in your location, in addition to /etc. If I remove the .cfg file in /etc, then gtk-server refuses to run, so in my installation that is the correct location. I remember from my previous gtk-server experiments (quite a few), that the libs called for in the config file had to be on your system. I will look into this tomorrow, since I am trying to finish an urgent job....

With kind regards,
vovchik

NinerSevenTango
Posts: 186
Joined: Sun 17 Jun 2007, 18:25

#89 Post by NinerSevenTango »

Thanks, vovchik, I believe that's enough information to save me a bunch of time fixing it. I can hunt those libs down and install them.

Happy coding!

--97T--

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#90 Post by jpeps »

Math '+' function in calc.bac needs () to add.

PRINT (f+g)

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#91 Post by BarryK »

Thanks vovchik for the .bac files. I have fixed them all in /usr/share/BaCon.

Wary 0.9.8 is now released:
http://bkhome.org/blog/?viewDetailed=01964
[url]https://bkhome.org/news/[/url]

User avatar
PjotAwake
Posts: 34
Joined: Wed 03 Nov 2010, 20:58
Location: The Hague, The Netherlands
Contact:

#92 Post by PjotAwake »

Folks,
~/Downloads/bacon/cli-demos $ sudo bacon c mastermind.bac
Starting conversion... done.
Applying indentation... sh: indent: command not found
Unable to delete file: No such file or directory
The 'c' is not needed - if you run 'bacon' without any arguments you'll see the correct usage.

The 'indent' only will be invoked if you use the '-p' option.

If you encounter 'broken' files then please note that there are plain 'bac' files on the website of BaCon also. So for each program listed simply remove the '.html' extension and download the original source.

For example:
working now, although "calc.bac" has strange way of adding: 20 + 35 = 2035
I am not able to reproduce this. Did you correctly download the .bac files (see above)?

Regards
Peter

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#93 Post by jpeps »

PjotAwake wrote:Folks,
~/Downloads/bacon/cli-demos $ sudo bacon c mastermind.bac
Starting conversion... done.
Applying indentation... sh: indent: command not found
Unable to delete file: No such file or directory
The 'c' is not needed - if you run 'bacon' without any arguments you'll see the correct usage.

The 'indent' only will be invoked if you use the '-p' option.

If you encounter 'broken' files then please note that there are plain 'bac' files on the website of BaCon also. So for each program listed simply remove the '.html' extension and download the original source.

For example:
working now, although "calc.bac" has strange way of adding: 20 + 35 = 2035
I am not able to reproduce this. Did you correctly download the .bac files (see above)?

Regards
Peter
Hi Peter,

Seemed to need 'indent' either way.

Code: Select all

~/Downloads/bacon/cli-demos $ sudo bacon calc.bac
Starting conversion... done.   
Applying indentation... sh: indent: command not found
I'm referring to the cli-demo:

Code: Select all

 
   REM Addition
    IF key EQ 49 THEN

        PRINT "Enter first number: ";
        INPUT f
        PRINT "Enter second number: ";
        INPUT g

        PRINT "\nResult is: ";
        PRINT f+g
        PRINT

NinerSevenTango
Posts: 186
Joined: Sun 17 Jun 2007, 18:25

#94 Post by NinerSevenTango »

Looks like part of my problem is no opengl installed.

I installed the pets for mesa-7.8.1-s131, because that looked like the latest ones (except for some that look like for a newer version of x-server).

So now I get the dreaded

Xlib: extension "GLX" missing on display ":0.0".
Error: couldn't get an RGB, Double-buffered visual


I made sure to change the Disable to:

Load "glx" #LOADGLX

in xorg.conf.

That's an awful lot of forum searching and fiddling around, and still no luck.

It would be a boon to mankind if someone who had gotten a recent build of Puppy working with all this stuff would release a remastered ISO. <Moaning snipped, I could go to a bloated distro if I didn't want Puppy so bad.>

User avatar
PjotAwake
Posts: 34
Joined: Wed 03 Nov 2010, 20:58
Location: The Hague, The Netherlands
Contact:

#95 Post by PjotAwake »

Hi jpeps,

Can you tell me which version of BaCon you are using? Hope it is build 19. Furthermore, are you using the BASH version, or the binary version?

Note that if you use the BASH version of BaCon, you *must* use BASH 4.x or higher. In case of the binary, it should have been compiled within a BASH 4.x or higher.

If the Kornshell version was used, all Kornshell versions are woking fine.

The calculator (shell version) works fine for me:
peter@laptop:~/programming/bacon$ bash --version
GNU bash, version 4.0.33(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
peter@laptop:~/programming/bacon$
peter@laptop:~/programming/bacon$ ./bacon.bash calculator
Starting conversion... done.
Starting compilation... done.
Program 'calculator' ready.
peter@laptop:~/programming/bacon$ ./calculator

-= BACON Calculator =-

1) Perform addition
2) Perform substraction
3) Perform multiplication
4) Perform division
5) Quit

Enter your choice...
Enter first number: 20
Enter second number: 35

Result is: 55

1) Perform addition
2) Perform substraction
3) Perform multiplication
4) Perform division
5) Quit

Enter your choice...
Thanks for using this calculator!
Please let me know,

Peter

Post Reply