Join us on Discord!
You can help CodeWalrus stay online by donating here.

Claw development system, a multiplatform programming platform [multiplatform]

Started by DarkestEx, May 07, 2016, 05:33:29 PM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

DarkestEx


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/bmuessig
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!
  • Calculators owned: TI-84+, Casio 101-S, RPN-Calc, Hewlett-Packard 100LX, Hewlett-Packard 95LX
  • Consoles, mobile devices and vintage computers owned: Original Commodore 64C, C64 DTV, Nintendo GameBoy Color, Nintendo GameCube, Xbox 360, PlayStation 2

Dream of Omnimaga

I'm glad this is still alive. I liked the idea and making it multiplatform is great. Try to focus on smaller platforms, so that you don't run into platform limitation issues, then move on to other platforms one at a time :)
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

DarkestEx

#2
Quote from: DJ Omnimaga on May 07, 2016, 07:13:00 PM
I'm glad this is still alive. I liked the idea and making it multiplatform is great. Try to focus on smaller platforms, so that you don't run into platform limitation issues, then move on to other platforms one at a time :)
So size wise, I estimate the core to be about 50 KB when completed and compiled with a settings enabled on the AVR platform. I plan on making a separate TI-83 a TI-84+ version in Axe unless Cumred_Snektron will make one in Assembler. I have already implemented all math, logic and most stack and array pool functions of the C version over the course of the last days.
The CPU is still not yet implemented.
  • Calculators owned: TI-84+, Casio 101-S, RPN-Calc, Hewlett-Packard 100LX, Hewlett-Packard 95LX
  • Consoles, mobile devices and vintage computers owned: Original Commodore 64C, C64 DTV, Nintendo GameBoy Color, Nintendo GameCube, Xbox 360, PlayStation 2

aetios

Will you limit speed to make easy cross platform development possible, or will heavy programs not be able to run on slower platforms?
ceci n'est pas une signature

DarkestEx

Quote from: aeTIos on May 09, 2016, 04:53:40 PM
Will you limit speed to make easy cross platform development possible, or will heavy programs not be able to run on slower platforms?
Well in theory I can't do anything to make heavy programs work on slow platforms, but the other way round. I plan on providing syncronous timer functions to allow games to run at the same speed everywhere and so that they can frameskip on slower platforms. Graphics will be scaled and you can choose an aspect ratio (not a screen resolution) at the beginning.
Use geometrical functions whereever possible, but of course, bitmaps will be supported aswell (but they will get scaled).
  • Calculators owned: TI-84+, Casio 101-S, RPN-Calc, Hewlett-Packard 100LX, Hewlett-Packard 95LX
  • Consoles, mobile devices and vintage computers owned: Original Commodore 64C, C64 DTV, Nintendo GameBoy Color, Nintendo GameCube, Xbox 360, PlayStation 2

Dream of Omnimaga

I don't think speed should be limited, but there should be a timer command for people who wants to throttle the speed of their programs. Also glad to see some progress :)
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

alexgt

Nice! I can't wait to try it out, will it by chance be compatible with the HP Prime :trollface: ?
  • Calculators owned: Ti-84+, Ti-Nspire, Hp Prime, Broken HP Prime, HP 48SX

Dream of Omnimaga

Quote from: alexgt on May 10, 2016, 01:50:05 AM
Nice! I can't wait to try it out, will it by chance be compatible with the HP Prime :trollface: ?
I don't think he knows HP PPL. D: Maybe if one day someone ports Linux to the HP Prime or if Jean Baptiste Boric's third-party firmware gets functional enough to run programs made in C/C++?
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

DarkestEx

Quote from: DJ Omnimaga on May 10, 2016, 05:49:56 AM
Quote from: alexgt on May 10, 2016, 01:50:05 AM
Nice! I can't wait to try it out, will it by chance be compatible with the HP Prime :trollface: ?
I don't think he knows HP PPL. D: Maybe if one day someone ports Linux to the HP Prime or if Jean Baptiste Boric's third-party firmware gets functional enough to run programs made in C/C++?
Yes. But claw can easily run as an operating system on bar metal if one likes so. Given just the C API claw could easily replace the old OS (except for actual float math which will be provided via an addon).
  • Calculators owned: TI-84+, Casio 101-S, RPN-Calc, Hewlett-Packard 100LX, Hewlett-Packard 95LX
  • Consoles, mobile devices and vintage computers owned: Original Commodore 64C, C64 DTV, Nintendo GameBoy Color, Nintendo GameCube, Xbox 360, PlayStation 2

Dream of Omnimaga

Well, a Claw OS can also do the job I guess (except if the user needs his calc for exams and must re-install the original firmware, but maybe dual-booting can be added). But that would probably be better discussed in https://codewalr.us/index.php?topic=973.0 if you ever get to that platform (since the other guy could probably help)

One thing at a time I guess ;)
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

alexgt

That would be cool to dual boot but I would want to get another Prime and use Claw on it so I wouldn't possibly damage my current calc.
  • Calculators owned: Ti-84+, Ti-Nspire, Hp Prime, Broken HP Prime, HP 48SX

Dream of Omnimaga

Yeah same, although if the new firmware thing is deemed safe, then what the authors could do is allow dual-booting. Actually, maybe a bootloader could be done instead that launches on calc startup then allows the user to load any firmware he wants afterwards (until next calc reboot).
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

alexgt

Yeah, that would be very useful. Come to think of it I already have a back up calc, my pseudo broken prime :P
  • Calculators owned: Ti-84+, Ti-Nspire, Hp Prime, Broken HP Prime, HP 48SX

Dream of Omnimaga

Well, if you know how to hook up a custom screen to it then you could definitively use it for testing. But I doubt the HP Connectivity Kit will detect the calculator screen with third-party firmwares so maybe you would be better off using your working calc as a guinea pig to test Claw and the broken one connected to the PC for HP PPL programming. Or someone could take care of it if you ship it and hook a screen to it.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

alexgt

I need my non broken one for programming since I only code on calc. So I will just go to someone that can replace the screen. For now I am loaning the broken one to my friend for math.
  • Calculators owned: Ti-84+, Ti-Nspire, Hp Prime, Broken HP Prime, HP 48SX

Powered by EzPortal