Posts in English
In this short QuickNote, we give a bit of info on Arpeggio; a python package to implement a (PEG) parser. Eventually, the parser is written in Castle – like all Workshop Tools. To kickstart, we use python and python-packages. Where arpeggio is one of the options.
To implement CCastle we need a parser, as part of the compiler. Eventually, that parser will be written in Castle. For now, we kickstart it in python; which has several packages that can assist us. As we like to use a PEG one, there are a few options. Arpeggio is well known, and has some nice options – but can’t handle left recursion – like most PEG-parsers.
Sooner as we realize, even embedded systems will have piles & heaps of cores, as I described in
“Keep those cores busy!”. Castle should make it easy to write code for all of them: not to keep them busy, but to maximize
speed up [useCase: In Castle is easy to use th... (U_ManyCore)]. I also showed that threads do not scale well for CPU-bound (embedded)
systems. Last, I introduced some (more) concurrency abstractions. Some are great, but they often do not fit
nicely in existing languages.
Still, as Castle is a new language, we have the opportunity to select such a concept and incorporate it into the language.
In this blog, we explore a bit of theory. I will focus on semantics and the possibilities to implement them efficiently. The exact syntax will come later.
I always claim that most computers will have 1024 or more cores before my retirement. And that most embedded systems will have even more, a decade later. However, it’s not easy to write technical software for those “massive-parallel embedded computers”, not with the current languages – simple because a developer has to put in too many details. Accordingly, the “best, ever” programming language should facilitate and support “natural concurrency”.
In Castle, you can easily write code that can run efficiently on thousands of cores.
As described in FSMs are needed Finit State Machines are great and needed – even tough no (main) programming
language has syntax support for it. But there are other (computer) language that (more-or-less) support the
corresponding State pattern.
By example plantUML –very populair by mature developers– has a syntax to draw them.
What can we learn from them? That is the topic of this post, before we define the Castle syntax.
Finit State Machines (FSMs) are great to model behaviour and control flow. Probably it is one of the most used design patterns; some developers are not even aware they are using it (when using the State pattern). And non of the well-known system-programming-languages does support it directly – it’s a shame;-)
This leads to sub-optimal, often hard to maintain code. In Castle, you can use define a FSM directly. Let’s see why that is essential.
In Grammar is code we have mentioned that many compiler-compilers reuse the Yacc invention “actions”. And we hinted already that Castle prefers an alternative.
Let’s see why the old concept is outdated … And what is easier to use.
In Compiler Compiler we have seen that we can define a grammar within a Castle-program. And we have argued that each grammars-rule can be considered as a function.
In this post, we look into de details of how this works. And will confirm grammars is code …
In Castle you can define a grammar directly in your code. The compiler will translate them into functions, using the build-in (PEG) compiler-compiler – at least that was it called back in the days of YACC.
How does one use that? And why should you?
Until now …
In this blog, we are examining another option: Apparently it is possible to load a remote MD-file. This gives new options. By example: host a (generated) html-file on one cloud-provider and the md-file on another-one.
Unfortunately this setup is unstable: It may work, and sometimes does; but it may fail too….
Within the concept as described in Revealjs + Markdown, a “html-template” is needed.
Although such a file is needed for each webslide, most of this html-template is “fixed”. Typically a standard one is composed once, and that one is configured per webslide. Both steps are described in this article.
I’m going to use it with markdown however…
Sphinx and reStructuredText (RST) are great tools to build and maintain documentation. However, the ability for “slide decks” is limited. In practice, most of my presentation are made by PowerPoint or Keynote – and so, are hard to maintain.
This has to be changed…