LoginLogin
Nintendo shutting down 3DS + Wii U online services, see our post

Lowerdash Beta

Root / Submissions / [.]

kldck_hulCreated:
Download:N334J313
Version:0.7.3 betaSize:65 KB

Lowerdash is an object-oriented language extension for SmileBasic v3.

It simplifies the structure of your code for you, leaving you free to focus on ambitious projects that can be compiled and distributed. It extends the SmileBasic instruction set to include fast constant dictionaries, namespaced modules and adds objects running on a dynamic memory model. Modules are designed to be used with or without dynamic objects. INCLUDES A PACKAGE MANAGER CHECK OUT THE MANUAL! REPORT ALL THE BUGS โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” Last update: 10/25/16 - New minor version removing privacy... !
Update History 10/22/16 - New minor version with _ 10/18/16 - New minor version with bug fixes 8/27/16 - Small bug fix 8/26/16 - Updated to 0.7 beta 3/20/16 - Updated to 0.6.5 beta 2/28/16 - Spicy new spoiler tags! 2/24/16 - Added code for 0.6 beta 2

Instructions:

To use Lowerdash initially, load "LDC" into PRG2.
EXEC "PRG2:LDC"

Lowerdash 0.7 introduces an entirely new compiler architecture. This lets Lowerdash be a more flexible language

See the manual for usage!

Guides

Files BALL.PRG - Accelerometer influenced ball object-oriented demo. HELLO.PRG - A hello world demo. LD.KEYS - Changes the editor keys to simple text macros for Lowerdash features. LOWERDASH - The Lowerdash runtime and standard library. Automatically loaded in PRG3 by the compiler. LDC - The Lowerdash compiler. Should be loaded in PRG2. Slot not used at runtime. LPM - Package manager for copying libraries. TEMPLATE - Sample main layout with stubs. __PKG - file describing Lowerdash to LPM. Can install compiler & runtime. _{CLASSES} - files loaded by the demo programs

Notes:

LIMITATIONS:

- No ON...GOSUB yet - No inline elseifs (I was too lazy to parse ifs in a loop... should be easy to add) - Calling a command like a function results in a command call with a single argument.

Version History:

Version 0.7 Beta: Garden Parsley ----------------------------------------- This release features an entirely new architecture, with separate lexing and parsing - meaning powerful new features can be implemented N334J313 - remove module level privacy from members. You can now set a member or var from anywhere after looking it up. These games. You no need security. - fix a bug with "dot" not respecting the type of the left-hand operand BUGS: 8EDX83A4 - remove static dispatch from lookups on me. Static properties will now be found dynamically if they are being called this way. Which is slightly slower - add _ as a placeholder for the current module. Lookups on _ will be statically dispatched, and if not found, will be a compile-time error. BUGS: some calls to the "dot" operator will stringify the left-hand side under incorrect conditions 45W372QE - fix multiple FOR...IN uses in one def - != is now an operator - fix lookup on static names such as MyModule.static BUGS: WXNEY3JJ - fix array literals - fix module labels, added case for gosub from def BUGS: - multiple FOR...IN uses in one def redeclare the loop vars - I didn't declare != as an operator. WHOOPS! J534DV3E - New . (dot) operator - New instantiation syntax - Cleaner function and command calls from lookups - More tolerant, punctuation aware lexing - restrictions on colons, quotes, and operators are all gone - Find more syntax errors, earlier BUGS: - array literals are not initialized - module labels are slightly malformed Version 0.6.5 Ballerific-er Beta: ----------------------------------------- This release adds a few missing features and fixes critical bugs in preparation for a refactor 2383C3HE - Array literals - DO can now take arguments - Fixed a serious bug with deleting string type members - Bug fixes BUGS:
Older Versions Version 0.6 Ballerific Beta: ----------------------------------------- QKAEAX73 - Bug fixes - IMPORTs inside an IMPORT are now compiled first, so that their VARs are visible. (They are still only compiled once) - PROTO() does not use dynamic dispatch to find the next prototype - Added TYPE to dynamically dispatch to the type of me BUGS: - While using _DEBUG, RETURNing from a command (not function) early will cause a slightly wrong call history NRSDAXTD - Improved error messages - PROTO() - DO() - Bug fixiest yet. BUGS: โˆš IMPORT from inside a file being compiled quotes its argument, so the string needs to be unquoted (Whoops!) โˆš ERR requires a string. It should be more lenient to print numbers. โˆš PROTO recurses once; 3 or more nested PROTO() calls will cause a stack overflow. THIS IS ONLY THE ACCESSOR, INHERITANCE WORKS Version 0.5 Ogiri Beta ----------------------------------------- 5KV4N8NV - Proto parsing fix BUGS: [COMMON] DEFs cannot immediately follow a MODULE (STATIC and EXPORT can) COMPILE_LIB uses the removed function chomp$ Closing a MODULE with END results in an error. Modules with members will overwrite inherited members 43x3x336 BUGS: Static lookups may chain to the wrong prototype. Dynamic lookups are unaffect. FEATURES: - Change how instances work - Fewer slots taken up - Deallocating memory - EACH - VAR parsing with REGEX patch Version 0.4 BETA ----------------------------------------- XKE8N53P CK33E3RJ BUGS: * _ lookup on instance member setters fails Parse multiple Lowerdash expressions per line. Imports, Module labels and Module-level access to + namespacing on module vars. Compile libraries that don't include the Lowerdash runtime to be used in other Lowerdash projects! Version 0.3 BETA ----------------------------------------- E45QF3L4 Faster runtime at expense of slower constructor. Module Vars, Typed Members, Nil$, Parsing fixes. You can't use : as a line separator. Version 0.2 BETA ----------------------------------------- RADQA3Z4 Initial public release with hot off the stylus prototypal inheritance.

Roadmap

0.7: - Generate parser using REGEX - Standard Lib .Lib - Improved Iterator commands
Future Updates 0.8 - Incremental compile - plugin system 0.9 - 2-pass static resolver plugin (no me("") needed) - private plugin 1.0 - Macros Future: - import Lowerdash into your library to save spaaaaaace in your files - Array members - Operators? - Better handling of :

Replying to:raimondz
I suggest that you use sprites instead of graphic for ball.prg because the drawing functions are too slow. In O3DS the speed test give the following values: Spirtes: 71542 Drawing lines: 18811 With that, the demo will slow down when the number of balls is greater than 30.
The speed test I ran were without any graphics. The largest slow down is in doing the context switching between the various ball or entity instances. If you take a look at Sprint, I use a sprite with most of the same control logic as the balls. The entity limit is very similar at ~25. Of course, Sprint has a lot more OOP going on. Nevermind, not quite comparable things... EDIT: I'll probably still update the demo. Working with sprites is still something most people need an example for. EDIT2: I am completely prepared to buy a hat and eat it.

Hi, I tried to make a program using the last version of lowerdash but there is a problem with the parser: it doesn't detect the operator "!=" correctly. For example, if I put this code inside a module:
IF A!=0 THEN ? "ENTER"
then it says "Expected Then but found Number" on the error. PS: The dot operator works great. That's one of the features that I wanted since you started this famework. Thanks

Replying to:raimondz
Hi, I tried to make a program using the last version of lowerdash but there is a problem with the parser: it doesn't detect the operator "!=" correctly. For example, if I put this code inside a module:
IF A!=0 THEN ? "ENTER"
then it says "Expected Then but found Number" on the error. PS: The dot operator works great. That's one of the features that I wanted since you started this famework. Thanks
Hi again, I found a way to fix this issue. I did this change on the label "@2" in the function lex:
@2
EP=P:ACT=22
IF S$[P-1]=="!" && S$[P]=="=" THEN INC EP
GOTO @E
The problem was that != wasn't recognized as an operation. It took me some time to figure out how the code works.

Replying to:raimondz
Hi, I tried to make a program using the last version of lowerdash but there is a problem with the parser: it doesn't detect the operator "!=" correctly. For example, if I put this code inside a module:
IF A!=0 THEN ? "ENTER"
then it says "Expected Then but found Number" on the error. PS: The dot operator works great. That's one of the features that I wanted since you started this famework. Thanks
That code probably took some time to understand because I have a generator for it. ;) Of course, leave it to me to forget that != is an operator... Wheres that test coverage program when you need it?

Hey cool! this'll be my first OOP language.

How does MDICT works?

Replying to:hakke
How does MDICT works?
MDICT stand for "Mutable Dictionary" The short answer: I haven't implemented this yet. Long answer: One of the idea with the upcoming versions of Lowerdash is to move as many library functions to separate files as possible. MDICT was planned to simply point to some automatic import - e.g. some _DICT.LIB library code. Right now, it looks like 12me21 has the fastest dictionaries with his library. I currently am looking at refactoring his code to do automatic type-casts to support all data types. If there's a definite need here, I can definitely fast-track this feature. (Shouldn't be too hard to argue, they are dictionaries...)

Bug Report: Code: module math STATIC DEF add(a,b) return a+b end end print math.add(1,2) Gives an error and the line compiled results PRINT _("math","add"))

There is a bug that appear on 3.5.2: GOSUB is ignored if it's called inside a def. This broke all the dictionaries generated by the compiler. If anyone is using lowerdash, then change the "gosub" to "goto" on the strings inserted on LDC and recompile your project. Since kldck_hul has been inactive a long time, I'll upload a bugfix of this issue.

Replying to:raimondz
There is a bug that appear on 3.5.2: GOSUB is ignored if it's called inside a def. This broke all the dictionaries generated by the compiler. If anyone is using lowerdash, then change the "gosub" to "goto" on the strings inserted on LDC and recompile your project. Since kldck_hul has been inactive a long time, I'll upload a bugfix of this issue.
I have made a key for a Lowerdash with:
  • Function lookup fixed
  • GOSUB bug fixed
Key: KNQXG1

Replying to:raimondz
There is a bug that appear on 3.5.2: GOSUB is ignored if it's called inside a def. This broke all the dictionaries generated by the compiler. If anyone is using lowerdash, then change the "gosub" to "goto" on the strings inserted on LDC and recompile your project. Since kldck_hul has been inactive a long time, I'll upload a bugfix of this issue.
Sorry for necroposting, but what changes did you make to the function lookup?

Are there any plans to port this to SB4? Now that I can actually use a keyboard Iโ€™m willing to give Lowerdash a shot. If kldck_hul is still inactive, I could try porting it. Is the GOSUB bug still in SB4?

Replying to:raimondz
There is a bug that appear on 3.5.2: GOSUB is ignored if it's called inside a def. This broke all the dictionaries generated by the compiler. If anyone is using lowerdash, then change the "gosub" to "goto" on the strings inserted on LDC and recompile your project. Since kldck_hul has been inactive a long time, I'll upload a bugfix of this issue.
I feel this might be useless, as the key is unavailable, but I want to explain the changes and the reasoning behind them: The "t_func" function in LDC declares a variable "R$" for the output, but returns one of it's parameters with an extra left parenthesis, so, for example, in the call ยซt_func(CHR$(34)+"fun"+CHR$(34),"x,y")ยป returned ยซ"fun")ยป instead of the desired ยซCALL("fun",x,y)ยป. So, for the actual changes: DEF t_func(N$,A$) VAR R$="CALL("+N$ IF LEN(A$) THEN INC R$,","+A$ INC R$,"," RETURN R$ END

Replying to:raimondz
There is a bug that appear on 3.5.2: GOSUB is ignored if it's called inside a def. This broke all the dictionaries generated by the compiler. If anyone is using lowerdash, then change the "gosub" to "goto" on the strings inserted on LDC and recompile your project. Since kldck_hul has been inactive a long time, I'll upload a bugfix of this issue.
I don't know if I downloaded this. Can you repost it?

Replying to:raimondz
There is a bug that appear on 3.5.2: GOSUB is ignored if it's called inside a def. This broke all the dictionaries generated by the compiler. If anyone is using lowerdash, then change the "gosub" to "goto" on the strings inserted on LDC and recompile your project. Since kldck_hul has been inactive a long time, I'll upload a bugfix of this issue.
No problem: [SDLXC38E]

Replying to:raimondz
There is a bug that appear on 3.5.2: GOSUB is ignored if it's called inside a def. This broke all the dictionaries generated by the compiler. If anyone is using lowerdash, then change the "gosub" to "goto" on the strings inserted on LDC and recompile your project. Since kldck_hul has been inactive a long time, I'll upload a bugfix of this issue.
Thanks!