General Discussion > Computer Projects and Ideas

Claw, the open embedded development system

(1/4) > >>

benedikt.muessig:

Introduction
For the last year, I have been working on Claw, a development system for embedded devices.
It has a very small RAM footprint and can run on systems with as few as 2 KB of RAM.
The VM's own memory footprint is tiny and most of the RAM remains to be used by the applications.
Claw will probably support multitasking in it's operating system releases and also support CEFS (Claw embedded read-only file system) and FAT32 for loading (and storing) files from and to.
The files are streamed and therefore can be as large as 4 GB (on 32 bit VM's) or 64 KB (per executable) on 16 bit systems. 64 bit is supported as well, though 4 and 8 bit is not.
Claw features and assembly language and an high-level language that will compile to CXE executables that Claw can execute. On any platform, as Claw executables are binary compatible!
So you focus on your code and write and compile it once. Claw will deal with libraries and device specific hardware! But this freedom is of course still limited by hardware factors (e.g. it needs a screen to display graphics, or processor speed and RAM size).

Memory
Claw is entirely stack-based and uses three main stacks. There is a call-stack which stores the source address every time you call another function. As Claw has file system support built-in you can of course call functions from libraries dynamically. Dynamic linking is performed by Claw automatically, so you don't need to worry about library versions. The next stack is the work stack. It stores the function arguments, is used for arithmetic and other instructions and is arbitrarily accessible. The third stack is the array pool which programs use to allocate parts of memory to store data to. New memory can be allocated at any time but as in a stack, only the last array can be deallocated at a time. There cannot be holes in the memory map.

Supported platforms
The architectures and systems that I will port Claw to include but are not limited to 32- and 64-bit Intel and AMD computers running Windows, Linux or BSD; AVR (especially Arduino Uno and Mega); MIPS (routers); ARM and XTensa (ESP8266). Somebody might want to do a port the TI-84+CE and I might do a port to the TI-84+ if I find time.

Online IDE
There is also a planned online IDE that includes an online compiler as well as a standalone, offline compiler and assembler that runs on Windows, Linux, and BSD. The assembler also works for Mac OSX.

Open source
Claw is an open source project and is on GitHub: https://github.com/muessigb
The chosen license is as permissive as it gets: The "new" / "revised" 3-clause BSD license.
This means Claw can be used free of charge, can be modified and used in closed source and commercial projects, as long as the name is not miss-used and I get credited appropriately.

Development status
I have completed most of the assembler so far and a good part of the VM. The compiler is just a draft so far, but will be started soon.  Most parts of Claw that are not yet made are already documented and planned but just not yet written.

Have fun!

Sorunome:
So this is like a custom language? How does it work? Does it compile to bytecode which gets interpreted?

SpiroH:
Not very clear to me either.

A  couple few questions:
1. How do/can you interface with the embedded system? GUI (eg, xml), High level language (eg. Java, C++), Assembly language, other?
2. What's the Claw timeline? When do you think you'll have a prototype ready that runs, say, on Windows or Linux or on a real embedded system OS.

I'm afraid this presentation is a bit difficult too general, abeit it seems interesting.

benedikt.muessig:

--- Quote from: Sorunome on July 24, 2016, 07:53:38 am ---So this is like a custom language? How does it work? Does it compile to bytecode which gets interpreted?

--- End quote ---
This is a three part system. There is an assembler or a planned compiler that will be used to generate bytecode. These are .cxe files that can be run in the Claw VM. It's similar to Java, where you write something once and run it on several systems without (much) modification. But Claw is targeted at embedded electronics such as Calculators, Arduinos, and similar electronics.
Code stays binary compatible between platforms, as Claw uses (kernel-) modules and libraries to implement native functionality and therefore does not rely on platform-specific code.
Claw is designed to completely try not having to worry about platform-specific things (too much).
E.g. graphics are plotted to a virtual canvas that translates to the actual screen. Vector graphics are preferred over normal bitmaps, as these will simply be blown up in squares.

It does get compiled to bytecode, yes, which is then run in a platform-specific virtual machine.


--- Quote from: SpiroH on July 24, 2016, 09:24:38 am ---Not very clear to me either.

A  couple few questions:
1. How do/can you interface with the embedded system? GUI (eg, xml), High level language (eg. Java, C++), Assembly language, other?
2. What's the Claw timeline? When do you think you'll have a prototype ready that runs, say, on Windows or Linux or on a real embedded system OS.

I'm afraid this presentation is a bit difficult too general, abeit it seems interesting.

--- End quote ---
1. There are two custom languages. One being Claw HL which is a Lua like language and then there is Clawsemble which is just assembly instructions for the virtual machine.
Claw has some custom audio and image formats that allow writing graphics code once and actually running it everywhere. More about that later.
2. The Claw Assembler is quite far already and I plan finishing it that week. The VM is halfway done; arithmetic, stacks, array pool and call stack are mostly or fully implemented. Missing are still the jumps and some basic file loading. Also there are no modules yet (e.g. string, graphics, io, network, ...).

SpiroH:
Thank you and congrats. Now is a lot more clear! Keep it up an good luck 'cause it looks rather versatile, so to speak.
I'll be looking forward to give it a go, when it becomes available for testing.

Navigation

[0] Message Index

[#] Next page

Go to full version