Re: [Freedos-user] Microsoft Open-Sources GW-BASIC

2020-06-02 Thread dmccunney
On Mon, Jun 1, 2020 at 5:30 PM Rugxulo  wrote:
> On Sun, May 31, 2020 at 11:26 PM dmccunney  wrote:
> > On Sun, May 31, 2020 at 10:35 PM Rugxulo  wrote:
> >
> > > So no, I haven't tried rebuilding this (yet?), and I'm no *nix fiend,
> > > but I do think AWK is a cool tool, maybe cooler than GW-BASIC (don't
> > > kill me!).
> >
> > AWK is a cool tool.  But it's not a full programming language for
> > building stand alone apps.  GWBASIC is.
>
> I don't think this particular BASIC is a compiler, only an
> interpreter. (The very first BASIC was a compiler.)

Doesn't matter.  You can create an entire application in an
interpreted language, and people did.  And BASIC being interpreted on
early machines was likely a matter of hardware available.  Kemeny and
Kurtz were working on larger multi-user systems. Consider the
Commodore 64, which had MS BASIC v2 embedded.  When you booted it, you
were in the interpreter, talking to BASIC.  BASIC on that machine was
embedded in a 8KB ROM.

> But there actually are compilers for AWK out there, even REXX! But
> most implementations don't do that. (Why bother? Interpreted is often
> fast enough.)

Awk and REXX are script languages, and were generally interpreted.
Awk is used in things like pipelines, where you call awk to query and
process a text file and pass the results to something else.  REXX was
the next generation of script language on IBM mainframes, intended to
provide more power than CLISTs.  (I was a dab hand at CLIST
programming back when.)  But you got REXX as a component of IBM's
VM/CMS OS.  VM was actually intended as a hypervisor, allowing you to
run other IBM mainframe OSes under it.  It was popular for cases like
taking code written for DOS/VSE and converting it to run under OS/MVS.
You could bring each up in a partition, with a production partition
running DOS/VSE, and a test partition where you handled conversions
and made sure things worked as expected under MVS.  Once you had
completed conversion and testing, with verification that everything
worked as designed, you could take down the DOS/VSE partition and make
the MVS partition the production environment.  (IIRC, VM/CMS imposed
about a 10% overhead, which is remarkably good. REXX subsequently got
brought up under other architectures.  (I have a version that works
under Palm OS.)

But hey, there are compilers for DOS batch files... :-p

> (untested by me, but just FYI)
> * http://awka.sourceforge.net/index.html

Convert awk to C, then compile to an executable.  I recall hearing
back when that AT was working on an awk compiler.  I have no idea if
this bears any relation to that effort.

> I'm actually a bigger fan of Sed, but that's much more limited
> (intentionally?). Also, AWK vaguely reminds me of REXX in
> functionality (although that, too, I only lightly dabbled in).
> Obviously, REXX was more known on IBM mainframes and OS/2.

Intentionally.  It has a different use case than awk.  SED is a stream
editor, explicitly intended to be called in a pipeline to perform
*scripted* edits on what is fed to it.

One bit often missed by DOS folks back in the day was that *EDLIN*
could be used that way.  Advanced batch programmers in environments
like corporate installations where they weren't allowed to install
third party code used EDLIN where they might otherwise have installed
SED.

> In recent years, BWK wrote a book on Go. That language has come a long
> way and done a lot. A lot of people from Plan 9 still work on that.
> Oh, one guy did write a compatible implementation of AWK in Go!

The main honcho behind Go is Rob Pike, with Ken Thompson and Robert
Griesemer contributing.  (Griesmer was a main developer for the V8
JavaScipt engine.)Pike and Thompson were colleagues of Kernighan
back the AT Bell Labs in Murray HILL NJ when Thompson and Kernighan
were designing Unix and Dennis Ritchie was developing the C language.
Go is specifically intended for concurrent programming, and addresses
weaknesses in C/C++ (primarily in memory management) that bite when
you are trying to create concurrent code.  Go's intent is to handle
the memory management for the developer, so they can just develop code
and not have to worry about it.

Open source advocate Eric S. Raymond has largely switched to Go these
days.  A paying project he's technical lead on is updating NTP.  That
was a morass of security holes and being used in DDOS attacks.  The
first challenge was scraping away decades of accumulated cruft in the
form of special case code for various old architectures and
environments.  The last I knew, his current version of the core NTP
code is about 70% smaller than the C code it replaced, and is far more
secure.  Many recent security bugs filed against NTP don't exist on
his code because his code removes the attack surfaces they target.  Go
turned out to be just the thing to use for the project.

> > It was initially written to perform "one liners", where you invoked awk
> > on a command line with the commands to 

Re: [Freedos-user] Microsoft Open-Sources GW-BASIC

2020-06-02 Thread dmccunney
On Tue, Jun 2, 2020 at 10:50 AM TK Chia  wrote:
> >> On a side note, you're using GNU Make and AWK (to cross-build?). I do
> >> wonder if DJGPP Make (or even other AWK implementations) would work
> >> for us here.
>
> DJGPP make is mainly just a port of GNU make, is it not?

Well, as part of a port of the entire Gnu/Linux toolchain, including
GCC.  Things like Scons are displacing make in some contexts, but make
isn't going away.

> As for the AWK portion, I have tested my script for munging the
> GW-BASIC source files with both GNU awk (gawk) and mawk.

Were any changes required to your original script to get it to work as
expected in gawk *and* mawk?

> > Awk is still useful on *nix - various things like build recipes may
> > use it in scripts - but for most purposes, perl has replaced it.  (I
> > consider that a pity.  Awk is smaller and faster, and perl may be
> > overkill for a lot of what you might need to do.  Former Busybox
>
> Agreed.  In fact I wrote an earlier version of my source-file-munging
> script in Perl, but later rewrote it in AWK. :-)



On the Linux side, I am seeing distros that no longer use text files
for configuration, and do everything in Python. Python is a cool
language, but if perl was overkill, Python is mass destruction.
Config files in plain text you can look at to see what they say and
how things are configured have attractions.
__
Dennis


___
Freedos-user mailing list
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user


Re: [Freedos-user] Microsoft Open-Sources GW-BASIC

2020-06-02 Thread TK Chia

Hello Rugxulo, hello Dennis,

>> What exactly does "semi-working" mean? It seems like graphics commands
>> aren't supported? That's no biggie (IMHO) as long as it can do simple
>> file I/O.

Well, direct commands seem to be working quite OK.  But yes, large
chunks of functionality --- graphics, (PC speaker) audio,
serial/parallel ports, etc. --- are simply not there yet.  And, I have
not quite fully tested the parts that are there.

There is still a long way to go, and I can probably use some help here.


Thank you. I never understand when people prefer ancient MASM over modern JWasm.


Well, this GW-BASIC version (1983) was written before JWasm even
existed.  (I guess we cannot fault the Microsoft developers then for not
catering to a build tool that simply wasn't.)


On a side note, you're using GNU Make and AWK (to cross-build?). I do
wonder if DJGPP Make (or even other AWK implementations) would work
for us here.


DJGPP make is mainly just a port of GNU make, is it not?  As for the AWK
portion, I have tested my script for munging the GW-BASIC source files
with both GNU awk (gawk) and mawk.


Awk is still useful on *nix - various things like build recipes may
use it in scripts - but for most purposes, perl has replaced it.  (I
consider that a pity.  Awk is smaller and faster, and perl may be
overkill for a lot of what you might need to do.  Former Busybox


Agreed.  In fact I wrote an earlier version of my source-file-munging
script in Perl, but later rewrote it in AWK. :-)

Thank you!

--
https://github.com/tkchia


___
Freedos-user mailing list
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user