Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Mon 19 Nov 2018, 10:12
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Getting BASIC programs compiled in Puppy?
Post new topic   Reply to topic View previous topic :: View next topic
Page 3 of 4 [46 Posts]   Goto page: Previous 1, 2, 3, 4 Next
Author Message
musher0

Joined: 04 Jan 2009
Posts: 12986
Location: Gatineau (Qc), Canada

PostPosted: Wed 12 Sep 2018, 07:41    Post subject:  

@PuppyT: I take a relaxing foot bath every day! Laughing
_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
Puppyt

Joined: 09 May 2008
Posts: 841
Location: Gatton, Queensland

PostPosted: Wed 12 Sep 2018, 20:45    Post subject:  

Well - so long as you don't expect a Basic foot massage here - your toe is always welcome Smile
_________________
Search engines for Puppy
http://puppylinux.us/psearch.html; Google Custom Search; others TBA...
Back to top
View user's profile Send private message Visit poster's website 
rockedge


Joined: 11 Apr 2012
Posts: 854
Location: Connecticut, United States

PostPosted: Sat 22 Sep 2018, 13:12    Post subject:  

I surprised myself and successfully compiled a BASIC program with FreeBasic
using Geany as the IDE...for some reason it all worked and made a binary that actually works...it doesn't do much but baby steps are called for here!

Just that I was able to use Geany and it's features with freebasic is a good start.
Back to top
View user's profile Send private message Visit poster's website 
Puppyt

Joined: 09 May 2008
Posts: 841
Location: Gatton, Queensland

PostPosted: Tue 25 Sep 2018, 22:16    Post subject:  

Thanks for the update rockedge - meant to respond earlier but got caught up with real-life issues. I was thinking that the Geany+FreeBASIC route is potentially the best for Puppy Linux, given FreeBASIC's QuickBASIC slant with a very similar syntax, and allows for features that are otherwise either impossible of hard to achieve in QB (32bit, high-res graphics modes). FreeBASIC apparently also works perfectly with FreeDOS having also compatibility with many DJGPP libraries - so ideal I guess for people with toes in many waters?
_________________
Search engines for Puppy
http://puppylinux.us/psearch.html; Google Custom Search; others TBA...
Back to top
View user's profile Send private message Visit poster's website 
ozsouth

Joined: 01 Jan 2010
Posts: 394
Location: S.E Australia

PostPosted: Tue 25 Sep 2018, 23:05    Post subject:  

I use Chipmunk Basic interpreter - minimal but interesting.
cbasic365.tar.gz
Description 
gz

 Download 
Filename  cbasic365.tar.gz 
Filesize  109.06 KB 
Downloaded  27 Time(s) 
Back to top
View user's profile Send private message 
Puppyt

Joined: 09 May 2008
Posts: 841
Location: Gatton, Queensland

PostPosted: Wed 26 Sep 2018, 20:50    Post subject:  

Hi ozsouth,
nice catch with Chipmunk Basic. I can only get the 'cbasic' executive working from within terminal despite making the file executable - but no biggie (Dpup Stretch 7.5 rc3). I was having trouble loading *.bas files, using the Chipmunk manual, but just now found that enclosing the filename in quotes as pictured below, does the deed nicely. Using Geany to correct typos from the "Werewolves and Wanderers" example text from earlier in this thread. Cheers Smile
chipmunkbas.png
 Description   
 Filesize   132.34 KB
 Viewed   180 Time(s)

chipmunkbas.png


_________________
Search engines for Puppy
http://puppylinux.us/psearch.html; Google Custom Search; others TBA...
Back to top
View user's profile Send private message Visit poster's website 
ozsouth

Joined: 01 Jan 2010
Posts: 394
Location: S.E Australia

PostPosted: Thu 27 Sep 2018, 04:03    Post subject:  

@Puppyt - I run (in a terminal, in folder where .bas file is):
cbasic progname.bas
Back to top
View user's profile Send private message 
puppy_apprentice


Joined: 07 Feb 2012
Posts: 212

PostPosted: Fri 05 Oct 2018, 15:25    Post subject:  

More BASIC interpreters from my own .pet archive (hope that will work on another Puppies).

These two are to big to store on forum:

bas-2.4.pet
http://s000.tinyupload.com/index.php?file_id=78867849587266674771

bwbasic-3.20.pet
http://s000.tinyupload.com/index.php?file_id=11975815007317291174

Bon Appetit!
cbmbasic-2.0.pet
Description 
pet

 Download 
Filename  cbmbasic-2.0.pet 
Filesize  43.12 KB 
Downloaded  21 Time(s) 
bas55-1.10.pet
Description 
pet

 Download 
Filename  bas55-1.10.pet 
Filesize  115.87 KB 
Downloaded  23 Time(s) 
Back to top
View user's profile Send private message 
nosystemdthanks

Joined: 03 May 2018
Posts: 363

PostPosted: Mon 05 Nov 2018, 23:28    Post subject:  

RetroTechGuy wrote:
I wonder if a Basic to Python converter exists?


i actually worked on converting qb64 to output python instead of c++, but i got bored with it because no one cared about it. its very tedious to edit qb64 to do this (i got as far as for loops, but it had some trouble nesting them.)

so that was the only basic to python converter i know of. and it didnt get far enough to bother linking to it. the source code was huge, the feature list was tiny.

what i was interested in was creating a new language that converted to python-- and it was heavily influenced by basic.

spoiler: i found it easier to translate most of my own basic programs to this language, but its not going to understand traditional basic programs.

one thing i wanted was to try to make the language easier than basic.

right, easier than basic. thats like saying easier than scribbling in crayon (i used basic for > 20 years.)

what i ended up with was a language partly inspired by logo, heavily inspired by qbasic, with some of the nicest features of python.

qbasic:
screen 12
x = 5
y = 10 : pset (x, y), 14

fig:
x = 5
y = 10 : pset(x, y), 14

whats different?

like puppybasic did, fig runs in a term window. it has a shell command like qbasic did. it also has arrshell, which dumps command-line output into an array.

but heres a closer look at the syntax:

x = 5
y = 10 : pset(x, y), 14

suppose youre niklaus wirth, and you want his style of assignment:

x := 5
y := 10 : pset(x, y), 14

there, that works too. but unlike python, "explicit isnt always better than implicit":

x 5
y 10 : pset(x, y), 14

this also works.

maybe you like how turtle graphics in logo doesnt have so much punctuation (it didnt, in some implementations)

x 5
y 10 : pset x y 14

this works. so does this:

x 5
y 10 pset x, y, 14

the variable on the left is the one that gets worked with throughout the line:

x 5
y = x times 10 : print

in basic that would be:

x = 5
y = x * 10 : print y

change the * to times and remove y:

x = 5
y = x times 10 : print

and you have fig code.

only "quotes for strings" and # hashes for comments are required. other syntax is optional.

it has a fixed parameter count per command:

p "hello" left 2

left always has 1 parameter.

it covers variables (including nice array features), input, output (including very basic graphics), basic math (including a few trig functions) and loops, conditionals and functions.

in fewer than 100 commands.

ive used it to remaster puppy, debian, devuan, void linux.

pet package: http://murga-linux.com/puppy/viewtopic.php?mode=attach&id=99110

google drive folder: https://drive.google.com/drive/folders/0ByUDhE3nQF8uU2N1ZTdXRnpIakU

this thing: https://imgur.com/oZ0zc1M

but it wont translate basic to python.

its the thing i worked on instead of translating to basic to python, because it was more useful to me and translating basic directly wasnt.

i was tired of basic and wanted something inspired by it instead.

i still use basic commands in it like print, int, mid, left, right, pset, cls, line, locate, lineinput...

it does colour changes (i let someone name it colortext, sorry) and locate in the term using ansi escape codes. you dont have to know the codes, it does that for you.

p = arropen "file.txt"
forin each, p
now each print
next

load file.txt into an array named p.

p = arrcurl "http://murga-linux.com/puppy"
forin each, p
now each print
next

i designed it for teaching programming. i wanted a language as easy as basic or easier, that address the features of python that made teaching it harder for beginners.

i realise that python is good for teaching. it was inspired by abc, a similar educational language the python author worked on.

some people have trouble with python. personally, i find fig easier and faster to write in for quite a few tasks.

i still use python when fig isnt enough. so does fig:

now = "inline python:" ; print
python
if 10 == 3 + 7: print ['hey this is inline python'][0]
fig
now "fig code" print

_________________
the end of the distro war, and the distro https://ptpb.pw/OnBT
Back to top
View user's profile Send private message Visit poster's website 
Puppyt

Joined: 09 May 2008
Posts: 841
Location: Gatton, Queensland

PostPosted: Tue 06 Nov 2018, 05:43    Post subject:  

Thanks for keeping the thread ticking over guys - life has been getting in the way at my end but I'm keeping tabs, hoping to provide a comprehensive 'how to' in due course. (So I can retrace my steps later on, mostly...)

@puppy_apprentice thanks for those pets - much appreciated. bwbasic - is that the version stock-standard with the FreeDOS1.2 release? Will download all to verify...

@nosystemdthanks, thankyou for taking the time to post here - I was reading your earlier posts regarding void earlier today, and skimmed through your [EDIT]"end the distro war" manifesto [in your signature! Missed it second time around] - very interesting read. A position I have applied for asks for (desirable) experience with Python and tensorflow - will have to put my programming abilities (???!) on skates... Appreciate your point about BASIC being supplanted by something like Python, btw.

UPDATE: On re-reading I see you have a lot in common with the ideals of the late contributer to the forum, learnhow2code. I mean that with the best intentions - I was never up-to-speed with some of the debates he was involved with. Please keep it up Smile

_________________
Search engines for Puppy
http://puppylinux.us/psearch.html; Google Custom Search; others TBA...
Back to top
View user's profile Send private message Visit poster's website 
phat7

Joined: 05 Jun 2015
Posts: 118

PostPosted: Tue 06 Nov 2018, 06:54    Post subject:  

Puppyt wrote:
On re-reading I see you have a lot in common with the ideals of the late contributer to the forum, learnhow2code.
The same unique posting format. Startling similarities indeed Wink
Back to top
View user's profile Send private message 
nosystemdthanks

Joined: 03 May 2018
Posts: 363

PostPosted: Tue 06 Nov 2018, 08:21    Post subject:  

phat7 wrote:
The same unique posting format.


considering we both claim to be the author of fig, its reasonable to assume we are the same person. there was a mixup with me and robert storey-- which i find absurd, storey was extremely helpful when i emailed him and knew more about a number of topics than i do. no one who knew him would mix us up. if you go to the distrowatch article that led to this confusion, its entirely clear he was not claiming authorship of the article. he only wrote under his name, and the article was attributed to me. it doesnt get much clearer than that.

its possible i have lh2c in the basement, or that he retired and had me take over like the dread pirate roberts, but either way ive spent the time since 2016 remixing distros using what i originally called "refrachtahrpup/mkrefpup."

it was someone from this forum that recommended changing the name of refractahrpup-- which i was pretty indifferent about or i would have chosen a less awful name the first time.

glad you liked the end of the distro post. like most of the things i write, i hope the ideas are interesting but they often describe things that are already happening or being implemented to some degree-- and the direction those things could move. i think there will be (and is) increasing amounts of automation in distro development, for one. when i was a kid, i thought it would be so much more practical if we put files on chips instead of floppy disks, but obviously that was a silly idea no one was ever going to go for.

_________________
the end of the distro war, and the distro https://ptpb.pw/OnBT
Back to top
View user's profile Send private message Visit poster's website 
Puppyt

Joined: 09 May 2008
Posts: 841
Location: Gatton, Queensland

PostPosted: Tue 06 Nov 2018, 18:08    Post subject:  

Embarassed
OK so I'm also going to deflect very briefly from the original purpose of the thread but I will loop back to it soon (no pun intended).
nosystemdthanks I only glance off various events writings on the state and nature of the Puppy Programming thread and its authors - so really any actual dot-joining I make is more in the style of Arthur Dent than Dirk Gently... but nevertheless your manuscript had me referencing parallels I have been long considering in the natural world. Firstly though - I feel you should define your abbreviations throughout (e.g., EEE) for us non- programming readership. Some of the examples you give are similarly esoteric to those not active in the field - a quick paragraph summary of those associated states-of-play would have been useful. But after sleeping on it I had a strong sense of your overall message. That is, you were not only philosophising on a natural progression of computing language that remains open-source (akin to the language we are communicating in now) and interacts with its instruments similarly, but that the education of such a language be effectively parallel to this. (Said poorly. I will get back to this.) How else do we inspire passive, monopolized consumers into becoming active integrators and creators? Brains are not computers of course. But what I was reading were some striking parallels with the concept of "Autopoesis" (self-organising) from neurobiologist philosophers Maturana and Varela. Life essentially defined as a dynamic loop interacting with its environment to preserve its functional and structural integrity (i.e., remain alive). Any aspect of that organism, sensory system, neuron - has the same 'drive' to protect its functional state within its respective "environ". So I was thinking that in terms of your argument of Programming/Technology/Sociology Education - that the true importance of a program is not how well it interacts with instruments/devices, but how it has interacted with the organic pattern (human) that wants a given role to be performed. (Linking back to the "Coming software apocolypse" posts and concerns.)

Whew. Need my second coffee. Anyways to get back to the OT - if we follow the history of BASIC and proprietary derivatives we can see (?) an evolution of interactions with increasingly sophisticated environments/devices that it has fallen short - ultimately lacks flexibility. But perhaps there is still value in experiencing historical languages - especially those that enable novice programmers to "tinker". Smartphones (android at least) can run free DOS and BASIC environments - there is hope yet for us who want to feel involved and grow with (our) technological progress.

_________________
Search engines for Puppy
http://puppylinux.us/psearch.html; Google Custom Search; others TBA...
Back to top
View user's profile Send private message Visit poster's website 
nosystemdthanks

Joined: 03 May 2018
Posts: 363

PostPosted: Tue 06 Nov 2018, 23:56    Post subject:  

cool stuff. i install dosbox on a regular basis, though i rarely run it. archive.org has an online emulator that lets you run dos programs in the browser.

dos is what i learned on, dos is related to how i found puppy in 2006. i was looking for a way to download monkey linux, which is similar to a way someone packaged puppy together with grub4dos. i wanted a gui version of pygmy linux-- which let you boot into it from the command line (or autoexec.bat) after loading windows 98.

that said, by 2011 i had exhausted most or all my uses for the dos environment. and running a programming environment in emulation had appeal, though it was limited. ultimately i wanted more to do similar tasks without emulation.

i think thats what most people want-- but, as long as there are people that want something else im in favour of them working to have what they want, unless it is available anyway. in that event, they can simply enjoy it.

and its not just that i want people to create their own software. i want people in general to understand the basics of programming, as the shortest route to really understanding computers. because it is a useful abstraction, as are applications, but one is an abstraction that keeps people mostly unaware of how things work-- and the other is a rudimentary understanding and familiarity with coding-- which is easy to teach if you make it simple but relevant.

when i spent years (literally decades) coding in basic, i knew if i found a language i wanted to replace it with that it would have at least a couple new features (the array handling in python is much nicer) and that coding would be easy without constantly looking up syntax. i knew that it wouldnt waste my time with unnecessary rules (necessary rules are one thing, but there are definitely unnecessary rules.)

i knew id have the same experience where id set out to code something, and expect it to take this many hours, only to find it working before i expected it to be ready. that happened with basic. python really is amazing.

but i get tired of all the parentheses and in basic, the dollar signs. i get tired of reimplementing trivial constructs in basic that are native and single-line efforts in python. i got tired of static typing-- in theory i like weak typing like js and bash have though in practice, dynamic/strong typing is what i like most.

then again i like that basic is mostly not case sensitive, and although python taught me to love indentation-- i like the option of not using that, especially when posting code snippets. i also prefer to put bash in strings to be used by the shell command-- because i get tired of all the ways bash can complicate that task, and i can work around it in a way that requires less tweaking to get things right.

people get the wrong ideas when they think about new languages. you can create them accidentally while parsing increasinly elaborate config files, and some of the most wildly successful languages are not created with any intention of being broadly useful or powerful or state of the art. python was intended as something to tinker with over the holiday season. creating languages is fun if you demand simplicity and stay devoted to that goal.

but i build most of the languages ive designed on top of python. it comes down to the legacy of basic-- if you had an operating system made of mostly python-based tools, anyone could learn to tweak those and they could be more cross-compatible than probably any other toolsets.

you can do that with any other language, except more tediously with javascript. basic doesnt have the libraries, modern versions of basic show their ties to more complicated languages like c and c++ and so do the problems that arise from them. unless you try to do everything with python 3, python wont do that. i think pypy will prove to be the best implementation, because they will support python 2 longer than the python foundation will.

python can be made friendlier, more easily than basic can at this point. and i want to have languages that are tailored to more general use, while modern versions of basic lend themselves most readily to building video games-- which is harder work and not easier. in the gaming industry meanwhile, things are far more abstract and less language specific. you create designs, which are abstracted to target multiple languages and platforms.

in short, basic is now a harder, more tedious way to learn to code-- which is why after more than 20 years i finally stopped enjoying it (i tried > 30 dialects, i reviewed the features of > 50 or more, which only led me to js and python. js is a real pain, but powerful.)

running old basic programs? we have the tools for that. youre probably better off with qb64 than fb for that purpose.

Quote:
perhaps there is still value in experiencing historical languages - especially those that enable novice programmers to "tinker".


very much-- though since every basic ends up being more tedious, i think the best reason to review older languages is to try to bring the simplicity forward into newer examples. i used basic-like command names because i like them and i think theyre easy to type and use. though i have tried replacing "pset" with "dot" or "dots" before. ive also experimented with creating a command shell that is easier to learn. but bash is more powerful.

_________________
the end of the distro war, and the distro https://ptpb.pw/OnBT
Back to top
View user's profile Send private message Visit poster's website 
Puppyt

Joined: 09 May 2008
Posts: 841
Location: Gatton, Queensland

PostPosted: Thu 08 Nov 2018, 17:01    Post subject:  

I really appreciate your experience on the matter nosystemdthanks. Did you formalise your comparisons of BASIC versions in any way? And you think q64 might be a better way to reinvigorate auld structured and unstructured games/programs rather than a BaCon-yad route to convert the code into tiny modern apps? Thinking about my original purpose of the thread I guess I wanted a project/environment/hobby I could work on to create something while retaining my original sense of discipline - without having to learn the foibles of a "new" computer language. But your insights have encouraged me to look seriously at supplanting my interest with Python. Unfortunately, no hobby-time for me Sad

In a related project I have been writing a paper related to the evolution of the Western alphabet. Current thinking is that many of the modern letters were based on the hieroglyphics (literally "sacred text") of the Ancient Egyptians. They were a combination of pictograms/logograms depicting entire concepts, syllables and even a few phoneme sounds - the latter being the basis for the modern alphabet system. However, over time the hieroglyphs expanded from about 200 commonly-used symbols that basically everyone could read - to over 6000 that only the scribes and priests had a working knowledge of. They preserved their own self-importance by bamboozling everyone else - the original "knowledge economy"? I guess I am wary of modern computer languages which might similarly work to alienate the common folk with more esoteric functions and constructs... or maybe I'm just being a neophyte. Dunno.

_________________
Search engines for Puppy
http://puppylinux.us/psearch.html; Google Custom Search; others TBA...
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 3 of 4 [46 Posts]   Goto page: Previous 1, 2, 3, 4 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

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


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1223s ][ Queries: 13 (0.0140s) ][ GZIP on ]