discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Cocoa based Basic Interpreter/Compiler made open source (GPL)


From: hns
Subject: Cocoa based Basic Interpreter/Compiler made open source (GPL)
Date: 6 Nov 2005 11:01:53 -0800
User-agent: G2/0.2

Dear GNUstep developers,

I have decided to make the CocoaBasic project, which is a compiler for
an OO BASIC dialect similar to REALbasic, open source and publish it
under the GPL.

What I hope by this posting is that someone takes care of the project
and adapts it to the benefit of the GNUstep/Cocoa community.

Some details about CocoaBasic:
* it uses the AppKit and Foundation frameworks of Cocoa
* it comes with an IDE that allows to browse classes, Methods, Objects
* it has a syntax aware editor
* it compiles into an internal representation similar to F-Script that
can be NSArchived
* it translates function and soubroutine calls as well as statements
into method calls
* it uses NSInvocation internally to execute/interpret at runtime
* it has a Plugin architecure so that additional modules can be added
* the Syntax is similar to REALbasic
* it has been developed on MacOS X 10.2 and ProjectBuilder - so it does
not yet use the most recent extensions that have not yet found its path
into GNUstep

This allows to use the full Cocoa tools to e.g. create windows. Here is
an example:

sub window
  dim o as NSWindow
  o=new NSWindow(WithContentRect:[[50, 50], [200.0, 200.0]],
styleMask:15+256, backing:2, defer:false)
  o.setTitle("Sizing Window")
  o.orderFront(nil)     // make visible
  o.set(Frame:[[20, 400], [400.0, 200.0]], display:true, animate:true)
  msgbox "quit" // pause until user action
end sub

or another one using NS(Mutable)String:

sub string
  dim s as String
  s="first part"+" and "+"second part"
  msgbox len(s)
  msgbox left(s, 5)
  msgbox right(s, 4)
  msgbox uppercase s
  msgbox mid(s, 11, 3)
  msgbox("123".intValue+1)
  msgbox s.stringByAppendingString(" and third part")
end sub

As you might notice, object.method(xxx) is translated into [object
method:xxx] and "xxx"+"yyy" to [@"xxx" appendString:@"yyy"]

Here is the link to the home page:
http://www.dsitri.de/wiki.php?page=CocoaBasic
and to the download package:
http://www.dsitri.de/download/CocoaBasic%20Public%20Source.zip

If there is enough interest, I can contribute more details on how it
works (or is intended to work) internally.

Nikolaus Schaller



reply via email to

[Prev in Thread] Current Thread [Next in Thread]