A BASIC equivalent for Linux?

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Message
Author
coldmonday
Posts: 59
Joined: Fri 10 Mar 2017, 16:23

A BASIC equivalent for Linux?

#1 Post by coldmonday »

Hi all,

I use BASIC (via DOS) for my simple interface experiments. Is there an equivalent to basic I can use with Puppy ?

I need to be able to access the printer port as I use it to interface with various projects.

Dave.

jafadmin
Posts: 1249
Joined: Thu 19 Mar 2009, 15:10

#2 Post by jafadmin »

Assuming you are referring to the parallel port when you say "printer port", you should look into what it's going to take for you to be able to actually do "pin popping" on a parallel port in linux. It may prove to be a bigger project than you imagined. Linux handles the LPT ports the same way it handles all device streams.

Under DOS/Windows the parallel port is promiscuous. Under Unix/Linux it is not. If you have cups installed you will have to exclude the parallel port if using as a controller.

https://www.htlinux.com/parallel_port_control_in_linux/

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

#3 Post by s243a »

If you are using puppy you likely have puppybasic included which is a varient of wxbasic. This version of basic looks far different then more modern versions of basic like VB6/VBA/vb.net.

Puppy also comes with a tool to convert basic which is wxbasic compatable to "C" this tool is called BaCon. There is some puppycode complied using BaCon. I forget if it is code related to the package manager or event manager.

coldmonday
Posts: 59
Joined: Fri 10 Mar 2017, 16:23

#4 Post by coldmonday »

Thanks to both for the replies.

It looks as if the sensible way to go is to just use my DOS 6.22 to run the GWbasic; my usual method.
No point in adding layers of complication.

Another question whilst I'm here.

I have download and installed 'Wine'. Apparently into Foobar.

But I can't launch it. It appears to be in /root/wine.

What am I doing wrong ?

Dave.

User avatar
Galbi
Posts: 1098
Joined: Wed 21 Sep 2011, 22:32
Location: Bs.As. - Argentina.

#5 Post by Galbi »

Open a console and run the command wine

What shows?
If it says command not found, well... it's not installed.

The command which wine will tell you where is installed the wine executable, in my Puppy it's in /usr/bin/wine and I also have a folder in /root/.wine (the point iit's VERY important, it's part of the name of a hidden folder).

Appart of all that, I'm not sure that wine is what you need to handle the printer port, for the reasons jafadmin mentions.

Wine is itself a layer of complication and I'm not sure that has access to the hardware

Saludos.
Remember: [b][i]"pecunia pecuniam parere non potest"[/i][/b]

williams2
Posts: 337
Joined: Fri 14 Dec 2018, 22:18

#6 Post by williams2 »

the sensible way to go is to just use my DOS 6.22 to run the GWbasic
https://freebasic.net/ FreeBasic is "syntax compatible to Microsoft QuickBASIC." It would not be as simple as using DOS 6.2, but you can do much more in such an environment.

OUT help page

User avatar
Galbi
Posts: 1098
Joined: Wed 21 Sep 2011, 22:32
Location: Bs.As. - Argentina.

#7 Post by Galbi »

And what about FreeDOS?
https://www.freedos.org
Remember: [b][i]"pecunia pecuniam parere non potest"[/i][/b]

muggins
Posts: 6724
Joined: Fri 20 Jan 2006, 10:44
Location: hobart

#8 Post by muggins »

For programming the parallel port this link could be helpful:

http://www.murga-linux.com/puppy/viewto ... 638#552638

User avatar
rockedge
Posts: 1864
Joined: Wed 11 Apr 2012, 13:32
Location: Connecticut, United States
Contact:

#9 Post by rockedge »

I use DosBox to successfully run Qbasic or QuickBasic 4.5. There is a PET right here DosBox is really robust and is easy to use and runs DOS software very well....but printing with it in Linux is tricky to impossible. It can be done, I have achieved it once, but that is like the info on how to build a pyramid....lost to time.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#10 Post by musher0 »

Hello, coldmonday.

Should you be looking for a current Basic, forum member did18 is also
active in the Gambas community. His Gambas-3 sfs can be found here.

Did18 also published a couple of Gambas utilities for PuppyLinux, such as
img2key, etc.

IHTH.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

coldmonday
Posts: 59
Joined: Fri 10 Mar 2017, 16:23

#11 Post by coldmonday »

Thanks for the responses.

Galbi,

I'm sticking with running my BASIC from DOS.
Also, as it is on an old 486 machine I can use Assembler to do the bits that need to be fast. (for most of my simple programs BASIC on the 486 is quite fast enough).

The reason I want Wine is to be able to run some of the Windows programs I have accumulated. Mostly pre-XP stuff.

I'll look into all the suggestions above.

Dave.

User avatar
tallboy
Posts: 1760
Joined: Tue 21 Sep 2010, 21:56
Location: Drøbak, Norway

#12 Post by tallboy »

I just found this comment on BASIC programmers:

Edsger Dijkstra about BASIC

It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.
:lol:

From http://www.cs.utexas.edu/users/EWD/tran ... WD498.html

An impressive man with an impressive career, worth reading about:
https://en.wikipedia.org/wiki/Edsger_W._Dijkstra
True freedom is a live Puppy on a multisession CD/DVD.

User avatar
6502coder
Posts: 677
Joined: Mon 23 Mar 2009, 18:07
Location: Western United States

#13 Post by 6502coder »

One suspects Dijkstra was exaggerating to make a point. In any case, there are BASICs, and then there are BASICs. Modern structured BASICs are a long way from the line-numbered BASICs of the 1960s. Dijkstra famously railed against the GOTO statement and I would imagine this was his principle objection to unstructured BASIC. That and the lack of ways to manage namespaces (i.e. using global variables everywhere).

User avatar
tallboy
Posts: 1760
Joined: Tue 21 Sep 2010, 21:56
Location: Drøbak, Norway

#14 Post by tallboy »

In the wiki, they wrote:Dijkstra was famous for his wit, eloquence, and way with words, such as in his remark, "The question of whether Machines Can Think is about as relevant as the question of whether Submarines Can Swim." His advice to a promising researcher, who asked how to select a topic for research, "Do only what only you can do". Dijkstra was also known for his vocal criticism. As an outspoken and critical visionary, he strongly opposed the teaching of BASIC.
He may have been one of those who has a personality you either love, or detest! :lol:
True freedom is a live Puppy on a multisession CD/DVD.

User avatar
RetroTechGuy
Posts: 2947
Joined: Tue 15 Dec 2009, 17:20
Location: USA

#15 Post by RetroTechGuy »

tallboy wrote:I just found this comment on BASIC programmers:

Edsger Dijkstra about BASIC

It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.
:lol:

From http://www.cs.utexas.edu/users/EWD/tran ... WD498.html

An impressive man with an impressive career, worth reading about:
https://en.wikipedia.org/wiki/Edsger_W._Dijkstra
Hey now! I like Fortran! :-)
[url=http://murga-linux.com/puppy/viewtopic.php?t=58615]Add swapfile[/url]
[url=http://wellminded.net63.net/]WellMinded Search[/url]
[url=http://puppylinux.us/psearch.html]PuppyLinux.US Search[/url]

User avatar
nosystemdthanks
Posts: 703
Joined: Thu 03 May 2018, 16:13
Contact:

#16 Post by nosystemdthanks »

tallboy wrote:It is practically impossible to teach good programming to students that have had a prior exposure to BASIC
of note:

low-level coders often laugh at dijkstra, because although he was a genius who transformed high-level coding into something almost certainly improved, his statement is a bit like saying that it is nearly impossible to ride a bike PROPERLY without training wheels.

more to the point: the version of basic he was complaining about lacked the features he considered "necessary" for good programming.

and most importantly, basic integrated those "necessary" features into the most popular dialects in the mid-1980s.

unless youre using line numbers in basic, his condemnation doesnt fully apply. unless youre using goto (which you can still find as jmp in every cpu, but thats okay) he condemnation barely applies.

but even if you are using line numbers, here is linus torvalds first program:

10 PRINT "SARA IS THE BEST"
20 GOTO 10

say what you will about mr torvalds, he turned out to be a fairly good coder either way.
[color=green]The freedom to NOT run the software, to be free to avoid vendor lock-in through appropriate modularization/encapsulation and minimized dependencies; meaning any free software can be replaced with a user’s preferred alternatives.[/color]

coldmonday
Posts: 59
Joined: Fri 10 Mar 2017, 16:23

#17 Post by coldmonday »

Beats 10 Print"Hello World"
20 Goto 10

User avatar
RetroTechGuy
Posts: 2947
Joined: Tue 15 Dec 2009, 17:20
Location: USA

#18 Post by RetroTechGuy »

coldmonday wrote:Beats 10 Print"Hello World"
20 Goto 10
I have a habit (and it ain't a bad one) of using GOTO in Fortran...

For example, when faced with a file of indeterminate length, I might handle it something like (indents aren't correct, since the editor is going to modify tabs):

Code: Select all

10 read(*,*,end=666) string_or_numbers_in_file
     [insert whatever processing that you're doing to the input]
     goto 10
666 end
Sure, there are _now_ tools to capture end of file, but in the bad old days, most wrote a do loop like

Code: Select all

    Do i = 1, 100000000
     read(*,*,end=666) string_or_numbers_in_file
     [insert whatever processing that you're doing to the input]
    End Do
666 end
;-) ;-) ;-)
[url=http://murga-linux.com/puppy/viewtopic.php?t=58615]Add swapfile[/url]
[url=http://wellminded.net63.net/]WellMinded Search[/url]
[url=http://puppylinux.us/psearch.html]PuppyLinux.US Search[/url]

lmemsm
Posts: 51
Joined: Wed 27 Jun 2012, 15:01

#19 Post by lmemsm »

RetroTechGuy wrote:
coldmonday wrote:Beats 10 Print"Hello World"
20 Goto 10
I have a habit (and it ain't a bad one) of using GOTO in Fortran...
I quickly jumped on the bandwagon of using try blocks in C++ to do error-handling when the ability was added to my compiler. After reading up on best practices for quite a while, I finally came across some information that did not recommend using try blocks in the same function. They work most efficiently when used across functions and files. They cause a lot of unnecessary overhead if a try block is used completely within the same function. So what are you supposed to use for error handling when try blocks aren't recommended? Turns out some of the recommendations for best practices were to go back to using goto. So, if I need to do error-handling in C/C++ inside a particular function, I use goto. It lets me have one place where a function exits and prevents cluttering the code with a bunch of indented lines that are within multiple if statements.

lmemsm
Posts: 51
Joined: Wed 27 Jun 2012, 15:01

Re: A BASIC equivalent for Linux?

#20 Post by lmemsm »

coldmonday wrote: I use BASIC (via DOS) for my simple interface experiments. Is there an equivalent to basic I can use with Puppy ?

I need to be able to access the printer port as I use it to interface with various projects.
I seem to remember some patches to DOSBox to allow use of the printer port. There were also patches for other additional functionality such as serial ports. Check the DOSBox forums for location of patches.

Post Reply