[www tom@zwizwa.be**20120520144556 Ignore-this: 3609435c4cfd98dd9d905d05f2ded5f8 ] hunk ./doc/staapl-blog.txt 4470 +Entry: Future +Date: Sun May 20 09:38:49 EDT 2012 hunk ./doc/staapl-blog.txt 4473 +I'm not sure if I can keep putting time in Staapl. The underlying +idea is interesting but there are so many practical issues (USB, PK2 +stability, serial console, compiler organization, bad error messages, +no documentation) that keep this from being stable. + +Another point is integration into "society". Up to this point, apart +from some pats on the backs, nobody cares. It all feels a little +solipsistic, which is fine if it's on the same level as "solving a +crossword puzzle". + +So I might continue working on it, but it clearly as a playground +until some of the issues mentioned above are fixed. hunk ./doc/staapl-ramblings.txt 59671 -Entry: DONE +Entry: Frustrated hunk ./doc/staapl-ramblings.txt 59681 + + + +Entry: Future of Staapl +Date: Sat May 19 23:05:28 EDT 2012 + +It's becoming quite clear + +- Staapl is (not yet) for practical things. It needs to grow. + +- I'm going to continue on the USB as an excercise in debugging. + + +I periodically get quite sick of this. The reason for that is that +I'm thinking goal-oriented instead of process-oriented. + +Main conclusion is that Staapl is still a hack, not really ready for +building "real" (non-exploratory) software with external constraints. + +The USB driver turns out to be a good exercise in debugging skills, +but it's going to take a LONG time to finish this, so I'm no longer +putting any "product" goals. It will take as long as it takes and +it's a process. + +I'm decoupling it from any practical tools (effect pedal), which will +be built in C. + hunk ./www/index.html 11 -Staapl is a programming language designed for low-memory PIC18 -microcontrollers aimed at writing maintainable programs with severe -RAM and Flash/ROM constraints. It goes where C can't go, and where -assembler would be too complicated. It is both wicked cool and a bit -weird. - +Staapl is a "macro assembler on steroids" targeted at PIC18 +microcontrollers. It's main use is for writing firmware optimized for +size. It goes where C can't go, and where assembler would be too +complicated. It is based on Scheme (code generator) and Forth (target +language / machine model). hunk ./www/index.html 19 -

Staapl is a collection of tools for resource constrained / deeply - embedded programming. It has a strong emphasis on code generation - techniques (macros, partial evaluation, metaprogramming, staging, - ...). Staapl is an extension of +

Staapl uses custom code generators (macros, partial evaluation, + metaprogramming, staging, ...) to generate code that is severely + resource-constrained. + +

Staapl is an extension of hunk ./www/index.html 25 - language. The aim is to provide a general framework to experiment - with - point-free - (algebraic) domain specific languages, but currently the focus is on - stack languages. + language, a Scheme dialect with strong support for embedded domain + specific languages (EDSL) written in terms of Scheme macros. A + Staapl target language is a collection of target code generator + macros. hunk ./www/index.html 30 -

Stack languages are an important class of point-free languages. - Staapl contains a general-purpose low level language based +

The language for the + Microchip PIC18 is a + language based on hunk ./www/index.html 34 - It currently has an optimizing compiler for the - Microchip PIC18 - architecture, and a tethering mechanism with interactive console for - running-target code updates. + It has an optimizing peephole compiler, and a tethering mechanism + with interactive console for running-target code updates through the + PicKit2 programmer. hunk ./www/index.html 38 -

Unlike traditional Forth which is - highly reflective, Staapl is built +

Unlike traditional Forth which is highly reflective, Staapl is + built hunk ./www/index.html 41 - with phase separation. Most of Staapl is organized around a + with phase separation, which breaks the circular reflection into + a directed language tower, creating a static semantics (the meaning + of the language doesn't change inside one module, in contrast with + original Forth's approach). Most of Staapl is organized around a hunk ./www/index.html 47 - concatenative combinator language like Joy. This syntax can - then be used as a base for different interpretations or as a target - for concrete syntax frontends. + concatenative combinator language + like Joy. + This syntax can then be used as a base for different interpretations + or as a target for concrete syntax frontends. hunk ./www/index.html 52 -

Point-free languages are easily manipulated on the meta-level - which makes them an ideal code generation target. 1. Such languages - have no variables that complicate code generation due to scope - issues (hygiene). 2. Thanks to the associativity of the operations - of concatenation (syntactically) and function composition - (semantically), computations are trivially partitioned in compile - time and run time. 3. Reliance on combinators for program structure - (as opposed to explicit recursion and loops) allows for the - derivation of program transformation laws that can be used for - program derivation or compilation to efficient implementations. +

(With the risk of being too vague..) While the PIC18 language is a + stack language, the basic code generator structure could support any + kind of "algebraic" language + (point-free + languages without variable bindings). Note that "point-free" only + refers to the basic compoisition mechanism. The core substrate of + Staapl is still Scheme, so primitive macros can have local variables + if that simplifies programming. This is used effectively in the + Staapl Forth for PIC18. + +

The basic idea is that point-free languages are easily manipulated + on the meta-level which makes them an ideal code generation target. + 1. Such languages have no variables that complicate code generation + due to scope issues (hygiene). 2. Thanks to the associativity of + the operations of concatenation (syntactically) and function + composition (semantically), computations are trivially partitioned + in compile time and run time. 3. Reliance on combinators for + program structure (as opposed to explicit recursion and loops) + allows for the derivation of program transformation laws that can be + used for program derivation or compilation to efficient + implementations. hunk ./www/index.html 78 - The phase I goal - to build a practical, well-factored, easily - extensible base system - is completed and put in maintenance - mode. It will serve as the basis for phase II: further experiments - with point-free domain specific languages for DSP/control, static - verification, and more elaborate compilation techniques to implement - them. + The phase I goal - a usable system for PIC18, be it with some rough + edges - is reached, and the corresponding code is put in incremental + improvement mode. + +

This base will serve as the basis for phase II: further + experiments with point-free domain specific languages for + DSP/control, static verification, and more elaborate compilation + techniques to implement them. hunk ./www/index.html 87 -

Staapl contains a preliminary port for the 12 and 14 bit PIC - cores, and I've been looking into porting staapl to PIC24/30/33 - (dsPIC). Other architectures will be implemented when needed. - Currently a a C code generator and analyser is in the works. - Prospected are an LLVM generator and a TI C64x linear assembly - backend. +

At this time, Staapl is only practical for the PIC18 architecture. + While writing other ports should be straightforward, it is a lot of + work. I have some code for the 12 and 14 bit PIC cores, and I've + been looking into porting staapl to PIC24/30/33 (dsPIC). The main + hurdle is writing a peephole optimizer for the new architecture. hunk ./www/index.html 100 +( NOTE: Some of this is a bit outdated. If you're interested and +having trouble getting things running, I'd be glad to help out in +return for some feedback. Send me an email. ) + + hunk ./www/index.html 134 +

Hire Me

+ +

Staapl is best fit for producing turnkey burn-and-forget binary +firmware blobs, with no constraints on tools for team-integration. +The basic idea is that I can be cheap as long as you don't need to +modify the code yourself. Not that you can't or that I'm reluctant to +provide source code and build tools, but there's a steep learning +curve involved. ( Powerful tools do take some investment. ) hunk ./www/index.html 144 -

I am currently looking for projects that apply Staapl to practical - problems in the embedded DSP/control field. Read this as: I would - like to raise the abstraction layer for your embedded application by - building a code generator for your specific ASM or C target. - I am particularly interested in integration with existing - development systems. Additionally, I am looking for projects that - allow the development of backends for different machine - architectures, and tune the backend API to make this process as - simple as possible. For more information please contact me - directly. hunk ./www/index.html 148 +

  • An interactive Forth console for the PicKit2 programmer. hunk ./www/index.html 180 -Wed Nov 9 10:57:07 EST 2011 +Sun May 20 10:45:32 EDT 2012