Shop OBEX P1 Docs P2 Docs Learn Events
PropBasic 3 Development log — Parallax Forums

PropBasic 3 Development log

BeanBean Posts: 8,129
edited 2014-02-15 14:50 in Propeller 1
Hi all PropBasic fans.
I thought I would start a post about the development of PropBasic 3 to let everyone in on the progress, and to get feedback about features and such.

Right now I am working on the expression evaluator. This is critical to get right since every parameter of every command will be run through it.

The EE also needs to keep track of what operators are used in the whole program so the code for them can be included (and unused operators excluded) to save code space.

The EE needs to do two jobs, it needs to actually evaluate the expression at compile-time so the compiler knows if the expression is a constant or not.
If it is a constant, then just the constant value is output as code.
If the expression is NOT a constant then the evaluator needs to generate all the code needed to calculate the expression on the propeller at run-time.

The EE also needs to do string handling. So an operator could take a string as an input and output a value (like the ASCII function).
Or an operator could take a value as an input and output a string (like the STR function).
Or an operator could take a string as input and output a string (Like LEFT$, MID$, RIGHT$).

Currently I have numeric expression working pretty well. I need to work on the string expressions next.
Here is a sample output:
PropBasic3 June 4, 2013

Evaluate 5 * (123 + 456)

  call #PushValue
  long 5
  call #PushValue
  long 123
  call #PushValue
  long 456
  call #ADD
  call #MULT

The constant is 2895

Operators used:
  COMMA
  LPAREN
  RPAREN
  ADD
  MULT

Bean

Comments

  • JonLJonL Posts: 1
    edited 2014-02-15 08:02
    Greetings!
    I am new to using forums so I hope I don't do anything wrong.
    I am trying to find latest info on PropBasic 3 and PropBasic Studio.
    Thanks,
    JonL
  • EE351EE351 Posts: 81
    edited 2014-02-15 08:13
    Bean, thank you for continuing to support PropBasic. I have only been using it for a few weeks and I'm really impressed with how easy it is to use. Keep up the good work and I look forward to trying PropBasic 3!
  • JonnyMacJonnyMac Posts: 9,107
    edited 2014-02-15 10:17
    Have you considered compiler development in C versus Delphi (Pascal)? It seems that would create opportunities for an open-source project in which you could get assistance from other programmers.
  • BeanBean Posts: 8,129
    edited 2014-02-15 14:00
    Jon,
    The compiler is a console app written in Delphi and can be compiled with Lazarus for other platforms.

    I've been waiting for the Propeller 2 to get finalized before working on PropBasic 3 any further. I want to be able to write it to compile for both Propeller 1 and Propeller 2. And I'd rather do it at the same time.

    Bean
  • JonnyMacJonnyMac Posts: 9,107
    edited 2014-02-15 14:08
    I understand it's a console app. My thinking was that if you wrote that compiler in C, you could get help from other programmers -- much like the Propeller GCC team has done. It's a lot of work to do everything yourself; I'm sure you'd appreciate having additional eyes on the code.
  • jmgjmg Posts: 15,173
    edited 2014-02-15 14:34
    I would suggest checking it is compatible with some popular PC Basic.

    eg I've been impressed with FreeBASIC, which seems good for quick/small projects, and has a useful debugger.

    The Debug allows users to get their code functions functionally/logically checked before deploying in an embedded device.
  • jmgjmg Posts: 15,173
    edited 2014-02-15 14:36
    JonnyMac wrote: »
    I understand it's a console app. My thinking was that if you wrote that compiler in C, you could get help from other programmers -- much like the Propeller GCC team has done. It's a lot of work to do everything yourself; I'm sure you'd appreciate having additional eyes on the code.

    Lazarus is reasonably popular :) ( tho I'd admit not as popular as C )
  • D.PD.P Posts: 790
    edited 2014-02-15 14:50
    JonnyMac wrote: »
    I understand it's a console app. My thinking was that if you wrote that compiler in C, you could get help from other programmers -- much like the Propeller GCC team has done. It's a lot of work to do everything yourself; I'm sure you'd appreciate having additional eyes on the code.

    Jon you do realize that BST ( one of the most advanced compilation tools to date for the prop and still widely used) was written in Lazarus. Object pascal is no worse / better than C or C++, just another procedural language with a different syntax. GNU Object pascal/lazarus is highly productive and compiled to highly optimize machine code as one must attest to with the aformentioned creation from BradC. Thanks Brad for all you did.


    Woops and forgot to mention that Lazarus is completely X-platform as well.
Sign In or Register to comment.