unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* BASIC->Guile Converter v0.6
@ 2003-12-01  6:25 Richard Todd
  2003-12-05  1:23 ` Neil Jerram
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Todd @ 2003-12-01  6:25 UTC (permalink / raw)
  Cc: richardt

Since the feedback was mostly good, I've decided to go forward with
BASIC->Guile.  Even if most projects never use it, maybe I can provide
documentation about my approach that could help others.

So, along those lines, I've made a number of improvements to the
BASIC->Guile converter today.  As before, it's available at
http://www.vzavenue.net/~rwtodd5128/index.html. It should now be
approaching a usable state for simple tasks.  The tests/*.bas files
show off most of the new features.

(I might have done more, but once I got to the point where I could use
BASIC to control GNU Robots, I kept playing...)

I've added a TODO list which plans the releases through 1.0. If anyone
wants to help with this, please do.  I work 60+ hours a week at my day
job, so progress may be minimal til the Christmas break.

----------------------------------------------------------------------
>From the NEWS file for v0.6:

  User can define functions and subroutines.
    - these can be called directly from scheme
  
  More BASIC constructs:
    -  WHILE/WEND
    -  DO/WHILE
    -  DO/LOOP
    - compound bool expressions with OR, AND, and NOT
      (before it was only TRUE, FALSE, <, >, and <>)

  Better error reporting (in the sense that it now stops parsing 
  when it sees an error, instead of reporting the first downstream
  problem that the error caused).


thanks,
Richard Todd
richardt  at  vzavenue  net


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: BASIC->Guile Converter v0.6
  2003-12-01  6:25 BASIC->Guile Converter v0.6 Richard Todd
@ 2003-12-05  1:23 ` Neil Jerram
  2003-12-05 23:51   ` Richard Todd
  0 siblings, 1 reply; 3+ messages in thread
From: Neil Jerram @ 2003-12-05  1:23 UTC (permalink / raw)
  Cc: guile-user

>>>>> "Richard" == Richard Todd <richardt@vzavenue.net> writes:

    Richard> Since the feedback was mostly good, I've decided to go forward with
    BASIC-> Guile.  Even if most projects never use it, maybe I can provide
    Richard> documentation about my approach that could help others.

Hi Richard,

I think this is great, and enjoyed reading your code.  Maybe Guile
will eventually fulfil its original goal of supporting multiple
languages via translation.

I have two questions.

- There are many BASICs; does your translator try to emulate one spec
  in particular?  If so, can you give me the reference for that spec?

- Does your translator support BASIC programs split across multiple
  files?  If it doesn't already, then I'd be interested in your
  thoughts on:

  - whether this is a sensible concept

  - how the translator might be extended to support this.

I appreciate you're busy - so if the easiest answer is just to add
this to the TODO list for now, please just do so.

Regards,
        Neil



_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: BASIC->Guile Converter v0.6
  2003-12-05  1:23 ` Neil Jerram
@ 2003-12-05 23:51   ` Richard Todd
  0 siblings, 0 replies; 3+ messages in thread
From: Richard Todd @ 2003-12-05 23:51 UTC (permalink / raw)
  Cc: guile-user


[-- Attachment #1.1: Type: text/plain, Size: 2720 bytes --]

Thanks for your interast!


On Fri, Dec 05, 2003 at 01:23:07AM +0000, Neil Jerram wrote:
> 
> I have two questions.
> 
> - There are many BASICs; does your translator try to emulate one spec
>   in particular?  If so, can you give me the reference for that spec?

These are my goals when language decisions come up.  

I'm mainly wanting to do:
  1) What is cleanest, code-wise.
     (supports guilesic as a learning tool)

  2) What mixes with guile best, especially for use in customizing
     other programs.
     (supports guilesic as a useful tool)

  3) What would hopefully surprise BASIC programmers the least,
     given that (1) and (2) keep me from replicating any one
     BASIC from the past
     (supports general acceptance of guilesic)

For the keywords/syntax, I'm going on my memories of GWBasic from way
back when, minus the line numbers.  I've used some knowledge of VBA
for Excel, since I've had to do some as part of my job.  I want this
to look like a BASIC to someone who knows a dialect, but I never
intended it to be a (for example) visual basic clone, though.

I am open to input if anyone thinks this is the wrong direction to go.


> - Does your translator support BASIC programs split across multiple
>   files?  

I'm not sure what you mean, exactly, so I might be answering the wrong
question here.  I'll try a couple ways:

1) If you are asking for a `LOAD "filetwo.bas"' command that you can
put in the middle of another .bas file, then I don't think that's much
of a hassle to implement...the lexer would just need to replace that
line with all the tokens from filetwo.bas.  The parser won't know the
difference.


2) If you have several BASIC files defining functions, just load them
up from scheme in a sensible order:

(for-each eval-basic-file '("one.bas", "two.bas", "three.bas"))

Or, if "two.bas" has some immediate code that calls a function in
"three.bas," then you could always slurp the files to a single string,
and run:

(eval-basic-string str)

on them. This will simulate one big file being read, and the
basic->scheme translator puts all the function definitions at the top
of the scheme output.

3) For modular programs, I plan to support modules that can be called
from BASIC or scheme.  I'd like to eventually figure out how to define
a BASIC module in a 'natural' way, which would require guile hooks, I
think.  Right now, I define BASIC modules via a scheme wrapper like
this:

(define-module (util conversions)
  #:export (Celcius2Fahrenheit)
  #:use-module (lang basic))

;; fixme -- make this find the file in a search path...
(eval-basic-file "/abs/path/to/conversions.bas")


Richard

[-- Attachment #1.2: Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 139 bytes --]

_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-12-05 23:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-01  6:25 BASIC->Guile Converter v0.6 Richard Todd
2003-12-05  1:23 ` Neil Jerram
2003-12-05 23:51   ` Richard Todd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).