Fog Creek Software
Discussion Board




Want feedback on new computer language


Dear Forum

I've developed a new high level computer language, including a compiler, developer environment, layout editor, debugger, documentation and website. I would appreciate any feedback on the language, developer tools or the website itself ( http://www.lingolanguage.com ). I've called it 'Lingo', and it produces Windows EXEs and is intended for 'desktop' development. I've tried to make it simple in the hope that beginner and intermediate programmers could do useful things with it. The new things about Lingo are:

- Automatic memory handling (allocation, deallocation) without GC.
- 'proper' list type not using linked lists internally (quicker for large lists).
- Table data type with segmented keys, can be stored in mem or on disk. This is more than a hash table since the keys can be structured and there can be multiple keys.
- No aliasing problems.
- Compilable preconditions and postconditions.
- Includes source for the developer environment and layout editor (dialog editor).
- No 'legacy' elements such as goto's, pointers, new, delete, manual memory handling, file handles, global variables.
- Run time structured expressions, eg x = {a, b+c(), d+1} are possible.
- Structured types can be loaded/saved from file directly, using different file formats. Eg you can load a text file into a list of strings, or save a table to an XML file.
- Module level exception handling.
- Uses RC/DLG files from C/C++ for layouts.

plus the normal features you get in most other languages.

Although comparisons are difficult, Lingo would probably seem most like a mix of Eiffel and VB3. I've tried to keep it easy to use (IMO VB3 hit a good balance between usefulness and complexity), also there's much good stuff in Eiffel that was never adopted.

Anyway, I welcome all feedback on the language or the website. Lingo is at a late beta/release candidate stage, and I've beta'd it locally and tested it since February under Win 95/ME/NT4/XP. The website has a download that doesn't require registration or passwords etc, and there are screenshots!

Finally, this isn't indended as an advert. While it's true I would like to sell copies of Lingo, I would rather have ideas than money from the readers here. Anyway you can't buy it because I haven't got that part of the website working. Probably you saw my previous post about Paypal.

Regards
Bill Rayer

Bill Rayer
Saturday, June 07, 2003

Wow! I see you've got RAD development.

But quite frankly... what I look for in a language is very high productivity when developing desktop apps.

I don't mind paying $1000+ for Borland Delphi, because it is extremely productive.

Productivity is, in my opinion, the killer feature of a today's programming language.

Look at the very rapid spread of Perl - it was very successful because it was very productive.

If you show me something more productive than Borland Delphi, you can have my 1000 $.

RAD Booster
Saturday, June 07, 2003

bill,

The programming language Lingo is a registered trademark of macromedia. You'll want to pick another name.

X. J. Scott
Saturday, June 07, 2003

Thanks for the feedback.

I haven't any definite thoughts about pricing, except as cheap as possible without seeming cheap.

Regarding TM issues, I've conducted prior art searches in group 9 in Australia and the UK (I'm an Australian/UK national). In UK Lingo is held by Linn Micro #2174989 and in Australia Lingo Language registered 591171 in 1992. Anyway I've had long discussions with Patent & Trademark attorneys on the legal aspects, and it gets boring.

I'm more interested in feedback on whatever technical merits Lingo may or may not have. I was really looking for feedback on the website or the language itself.

Bill Rayer
Saturday, June 07, 2003

Hi, put the language reference on the site, I don't see it there

Daniel Shchyokin
Saturday, June 07, 2003

Threading?

punter
Saturday, June 07, 2003

Code samples on the site. I moved on after not finding any. I noticed you can download a demo, but I'm not that interested yet.

Big B
Saturday, June 07, 2003

The LRM is about 1000 pages and I haven't put it on the site. Would it help if I put the smaller manual on the site (Learning Lingo)?

Or should I put the Language Report chapter of the LRM, which is a technical in-depth view of Lingo?

Regarding code examples, look at Tech Support-Getting Started - 1 and 2. These are about 10 lines so as not to frighten people.

If you'd like a larger example, tell me what you'd like done and I'll write it.

Bill Rayer
Sunday, June 08, 2003

Bill,

As you know, I've played with this for while.

Workflow is letting the program down at the moment.

I want to write a program where I enter a name, hit the hi button and a message box says 'Hello <name>' back.

So I open up the IDE and go New Dialog.  I drop on a Text Field and a Button.  Change button label to Hi and hit run.

A msgbox says 'It is not possible to use the 'Run-Start' command.  '<untitled is not a module, it does not have the correct extension.'

So where do I go from here?  The error mesage tells me I need to change the extension of a file.  I know this can't be right.

So I go to help.  Getting started doesn't tell me how to create a dlalog.

Finding dialog in the help index gives me two topics:  RC File Dialog Statement and Reserved words for future use.

I'm at a dead end.

Ged Byrne
Sunday, June 08, 2003

So,

I've finally figured out by trial and error that I wan to Use New Program instead of New Dialog and I've created my dialog again. 

Hit run and I've got a dialog.  Now I want to make the button do something.

Nothing on right click, I double click and I'm taken to the main function.  I know all about winmains so I know what's going on.  What percentage of you market will though?  VB programmers know about on<Event> and Java programmers know about listeners. 

There is no help for EventID, but I do see Event List.

This gives me the Event List topic and I finally find the click event.

The whole process lacks affordance.

The final program looks like this:

Lingo 1 module App1
Callback Function main (In  EventId:Integer
                            ControlObj:control
                            Key:Integer
                        Out Cancel:Boolean)
contents

Callback Function main (In  EventId:Integer
                            ControlObj:control
                            Key:Integer
                        Out Cancel:Boolean)
code
  select EventId
  case CLICK_EVENT =>
      if ControlObj = Me.PushButton1 then
          call Msgbox ("Lingo Greetings", "Hello " + GetText(Me.Edit1))
        end if
  end select
end function

end module


A lot of trial and error was involved, which wasn't helped by slow comilation.

Hope the comments are taken in the constructive manner they are intended.  I like the idea of Lingo a lot.

Ged Byrne
Sunday, June 08, 2003

The trend on GUI is to be somewhat independent of the native option.
ex: Swing, SWT, wxWindows, GTK+, QT, XUL, Windows.Forms, CLX, and it certainly is very difficult to develop a GUI toolkit comparable to  those. Perhaps it would be better for your environment to support one of those.
Just thinking aloud :-)
Good luck

Ioao
Sunday, June 08, 2003

Hi Ged

Thanks for the feedback. It is appreciated, and is much more useful than the bland "looks great" type of comments. It's an experience for me looking at Lingo through someone else's eyes!

I intended File-New-Dialog for (i) adding a new dialog to an existing program and (ii) creating a new RC file on its own. The way you used it (create new dialog and press run) did not occur to me, though it's 100% reasonable. To make it work, I could disable File-New-Dialog until a module is open, or I could have the Run command realize there is a dialog without a main module, and prompt to generate a main module. I'm not sure which is best.

There's a similar situation. If you have a C/C++ RC file, you can use Tools-Explore resource file to load the RC file, but if you press Run you'll get the same error message. Basically the compiler is unhappy because it has dialogs and no code.

Perhaps auto-generating a main module is the way to go.

To fix the confusing parts of the help file, I'll change it so that 'Dialog' and 'How to create a dialog' link through to a compilable example.

Regarding the window functions, I was unsure whether to have a single function with case options for each event (like now), or to have event handlers in the form <dlgname> . <eventname>, so that your event function would end up something like this:

event Function main.Click_Event (In ControlObj:control
                        Key:Integer
                        Out Cancel:Boolean)
code
  if ControlObj = Me.PushButton1 then
        call Msgbox ("Lingo Greetings", "Hello " + GetText(Me.Edit1))
  end if
end function

Finally you should use the Command event for Pushbuttons and menu choices. Type Help-Index in the IDE, type "command event", when viewing the topic click the "Example" button. This copies the example to the clipboard, you can paste it in the IDE and compile it.

Looks like I know what I'm doing on Monday now :)

Bill Rayer
Sunday, June 08, 2003

Um, if you have automatic memory management, but no garbage collection, how do you deal with garbage?

Phillip J. Eby
Sunday, June 08, 2003

Bill,

At the moment you have 4 options on new:

Text File
Module
Program
Dialog

Of these Program is given no special importance.  Text file is the only one to have a short cut key.  It seems to me you are take an implementation rather than task based approach.

I don't think the problem is that the user can press run when they are working on a resource file.  If is just that for the uninitiated the path taken - File New Dialog - seems just as appealing as the correct File New Program. 

As you say, in C/C++ you get into the same postion by going Tools/Explore.  By the time somebody is using the advanced features on the Tools menu they should be able to deal with the error message.

However, the File/New menu is the starting place for a Window user.

Imagine if Word had the command for New Macro on the File menu instead of being hid away on Tools.  How many unsuspecting newbies would end up typing their memos in the VB editor, complaing because they kept getting Syntax error messages.

Ged Byrne
Sunday, June 08, 2003

Phillip Eby - the RTL knows when a block of memory is no longer required and frees it immediately. So there is no garbage - instead the runtime library puts stuff in the bin when it's finished with.

Ged - I originally planned File-New as a starting point for all possible kinds of file, and using File-New-Dialog for a new program never occured to me. It should have occured to me though, because to a newcomer it *is* just as appealing.

And if I did change File-New-Dialog to also create a new module, this is confusing since it's very similar to File-New-Program. And there should not be two menu commands that do very similar things. Also File-New-Dialog does have a use which I just remembered - when the project window is open it adds a new dialog and window function to the program.

Following your hypothetical "Word File-New Macro" example, there should be a different menu location where new objects of a more complicated nature are created. MSVC4 had (from memory) a top level Insert menu, which was enabled only when a project was open. This was for adding new .c files and .rc files.

The implementation vs task-based approach is interesting. So it looks like, New Dialog doesn't belong where I put it, and there should be a different place for new objects that are only meaningful in the context of an already-open program. I'm glad I haven't changed it yet...

Bill Rayer
Monday, June 09, 2003

Bill,

I would like to add that I really like the Program Window.  Since I discovered it I'm finding putting together my programs so much easier.

Ged Byrne
Monday, June 09, 2003

Bill:

On the File->Open topic, you will want to sort of 'suggest' what is most likely wanted, and this can be done by 1) the ordering of options, where the most used goes from top to bottom, but the very bottom option seems to be used nearly as often as the first option, and often has special significance or use (such as being "Properties" in context menus, "Options" in Tools menus, "Exit" in File menus, "Full Screen" in View menus, etc. ) - and 2) bold text.

I reccommend you bold "New Program", and at the very least make it the first option (or at least the first "New" option).

I also reccommend the use of graying to remove an option when it does not seem appropriate to choose it, like with Dialog. Would anyone want to create a new dialog when there is no project or module open? Later on, it will likely be assumed that "New Dialog" will create a new dialog WITHIN the current project or module, so that's a behavior you'll need to consider.


I highly reccommend you post "Learn Lingo" sort of articles, as I know it's the first thing I ever do when considering a new language. And I pretty much mean that litterally - I check the About page, then I go straight to the Learn XYZ page.

As the only thing I much consider anymore with languages is productivity in most common tasks, ability to handle those difficult "tight spots" that come along (such as where you have to do something which the designers apparently never thought of, or that is just really wacked out anyway), and - this is perhaps the biggest showstopper of all - the ability to leverage already existing code; that last one means good, solid, well-designed, reliable libraries, or language interoperability (preferably both). Why? Because I am increasingly annoyed at the prospect of spending my effort solving a problem that someone else has already solved - what a waste it is.

On a last point, I also parrot the objection to doing, as a human, something a machine can do as well or better than I can.

Plutarck
Monday, June 09, 2003

Oh, btw, one more thing: you'll likely highly want to read these articles for ideas and/or inspiration: http://paulgraham.com/arc.html

He's designing a language as well, and I think he has some very profound insights there, such that I'm actually excited about what he's cooking up.

Plutarck
Monday, June 09, 2003

Bill,

I like the Msgbox command.  Using newline delimited list of button names is a great idea.

To save time perhaps you could have some constants available for the standard OK, YesNo, Cancel/Retry, etc/etc.

Ged Byrne
Tuesday, June 10, 2003

Bill, are you using reference counting for your memory management?  If so, how did you deal with the circular references problem?

Mike McNertney
Tuesday, June 10, 2003

I'd really like to hear more about your automatic memory management scheme, it seems to me too that you must be using a reference counting technique if you say that you immediatly know when something is garbage.<br><br>So, as asked before, what about memory cycles? Why not 'real' garbage collection?

Old Trashbarg
Tuesday, June 10, 2003

Ged - Glad you like Msgbox and the button string - you can have up to 7 different buttons. There's also Inputbox (like in VB but with a prompt string) and Listbox. Help-Index works for these 3 (I just checked :) )

Plutarck - As you implied it's very unlikely anyone would want to create a new dialog when no project is open. I left the option there just in case, but the consequences are extra confusion which I didn't anticipate. I can see now that it does impede workflow, like Ged said.

I'm still unsure how to fix it. Either it gets disabled when no project is open (like you said) or it migrates to an 'Insert' menu which is used for inserting files into open projects. Your idea is simpler though, I would prefer not to have to restructure all the menus now.

Plutarck and Daniel Shchyokin - On the website, go to "Tech support" and scroll down to "Technical information". There are links to PDF files for the Learning Lingo manual, and the language report (the latter is very detailed).

Memory management - Lingo has no pointer type and it's not possible to set up structures with loops in them, or to do *anything* with pointers. Thus you can't make circular linked lists or any other structure with loops in it. The RTL provides higher level data types so you don't have to handle memory. I didn't want GC because it could cause random pauses to occur at run time.

Bill Rayer
Tuesday, June 10, 2003


// Module with Msgbox constants for Lingo
// (including MB_CONTINUEPANICSTOP and
// MB_YESNO_POLITE which you won't find in
// windows.h!)

Lingo 1 module MsgboxButtons

const
MB_ABORTRETRYIGNORE:string[*]
MB_OK:string[*]
MB_OKCANCEL:string[*]
MB_RETRYCANCEL:string[*]
MB_YESNO:string[*]
MB_YESNOCANCEL:string[*]
MB_CONTINUEPANICSTOP:string[*]
MB_YESNO_POLITE:string[*]

contents

const
MB_ABORTRETRYIGNORE:string[*] <-
  "Abort" + Chr(10) + "Retry" + Chr(10) + "Ignore"
MB_OK:string[*] <-
  "OK"
MB_OKCANCEL:string[*] <-
  "OK" + Chr(10) + "Cancel"
MB_RETRYCANCEL:string[*] <-
  "Retry" + Chr(10) + "Cancel"
MB_YESNO:string[*] <-
  "Yes" + Chr(10) + "No"
MB_YESNOCANCEL:string[*] <-
  "Yes" + Chr(10) + "No" + Chr(10) + "Cancel"
MB_CONTINUEPANICSTOP:string[*] <-
  "Continue" + Chr(10) + "Panic" + Chr(10) + "Stop"
MB_YESNO_POLITE:string[*] <-
  "Yes please" + Chr(10) + "No thanks"

end module

Bill Rayer
Wednesday, June 11, 2003

You said that " I didn't want GC because it could cause random pauses to occur at run time". However, pausing is not a fundamental trait of garbage collectors. Incremental garbage collectors don`t pause (and can be quite efficient).

Also, reference counting *can* pause. If you have a deep-nested structure, deleting the last reference to it will take a long time. Refcounting also causes lots of memory swapping, because you have to "touch" avery piece of garbage.

Dror Livne
Thursday, June 12, 2003

So what memory management method are you using, stack unwinding?

Ged Byrne
Thursday, June 12, 2003

I'm not using GC or reference counting. It would be closest to a stack-based system, although most data is stored on the heap. Memory is freed when the objects fall out of scope, or when the structure is resized and the memory is no longer needed. eg:

  // (assume a is an array of strings)
  a <- {"one","two","three"}
  call redim(a,1,2)
  // now a has two elements (a[1] and a[2]) and
  // a[3] is freed.

There's nothing complex going on here.

Bill Rayer
Thursday, June 12, 2003

Lingo Memory Handling take 2

Here are more details in case my previous answer was too short.

Before starting, remember there are no pointers, no address-of operator, no new or delete operator, and no language features for directly accessing memory (that's a requirement in a HLL). Thus a Lingo pgmr could not set up a circular linked list, for example. The RTL does not use GC or refcounts in any way.

When objects or variables are declared, memory is allocated on the stack and usually the heap. Eg an array might have a small stack allocation, and the rest on the heap. Constant objects are declared similarly, eg a small global allocation, and the rest on the heap. The nature of the heap allocations depend on the array component type. Eg a 1D array of strings might store 1 block per component, a 1D array of records might have 1 block per field per component.

When passed to functions as 'in' parameters, numeric types (fixed point, ints, bools etc) are passed by value. All other types and objects are passed *by reference*, regardless of the mode (in, inout etc). This is transparent to the programmer, all they have to worry about is whether the parameter is an 'in' or 'inout' etc. No special notation is used.

When structured types change in size (eg arrays are redimmed, lists have elements added/deleted) the extra elements are allocated or freed as reqd. Again this is done by the RTL.

When values fall out of scope on function return, the stack allocation becomes invalid (same as in all languages). However the RTL deallocates any heap-based allocations that belong to the popped stack allocation.

On program termination, there is an optional feature to walk the allocated block list to check for heap leaks (I do this in the daily build script!) Normally this isn't needed as Lingo isn't leaky.

The net result is memory is allocated as needed and cleaned up when no longer required.

Bill Rayer
Thursday, June 12, 2003

So, in effect, to create any significant data structure, a developer has to reinvent pointers using array indexes, and invent their own memory management using those indexes.

I hate to say it, but it sounds like on the lanugage level you've just reinvented BASIC.  Depending on your target market, of course, that may not be such a bad thing.

Phillip J. Eby
Friday, June 13, 2003

Not at all. Lingo is a VHLL and the significant data structures are included as native types in the language.

Bill Rayer
Friday, June 13, 2003

*  Recent Topics

*  Fog Creek Home