flat assembler
Message board for the users of flat assembler.
Index
> Programming Language Design > basics of a minimal language interpreter or compiler |
Author |
|
pabloreda 01 Aug 2020, 18:04
the minimal is 1
https://en.wikipedia.org/wiki/One-instruction_set_computer |
|||
01 Aug 2020, 18:04 |
|
DimonSoft 01 Aug 2020, 21:11
MajorDill wrote: My thinking is you would need 3 basic types of variables Well, you’ve basically enumerated the basic feature set of classical Basic language (pun intended). OISC has already been mentioned, so I’ll just add that, technically, even the retrieval of random number, date and time can be mapped to the READ statement. Having a GOTO, an assignment statement, a few basic operators, an IF and a means to access arbitrary memory address might be enough for pretty comfortable usage. The rest is easily built on top of those. |
|||
01 Aug 2020, 21:11 |
|
MajorDill 05 Aug 2020, 21:49
After playing around with it a bit I think a 32-bit program interpreter could be done at under 10k. Shorting all commands to 1 character and putting everything; program, variables, and stack into one string with pointers and no error checking could do it. If I remember right Tiny Basic (8-bit) was around 4k-6k
and only handled integers, no strings, arrays or subs/functions. I don't know about goto (it seems like cheating). Does anyone know of anything smaller? (BrainF**K, Befunge and others don't count - you have to be able to write actual programs on it, like chess or Go) Someone pointed out MOUSE by Dr. Peter Grogono around the 1980's but you need a PASCAL compiler and still doesn't do strings. (I don't know the compiled size) |
|||
05 Aug 2020, 21:49 |
|
pabloreda 06 Aug 2020, 01:35
in forth is very common ultra small system,
my 32 bits lang is 34kb with compiler to bytecodes, interpreter, vector graphics with antialias and only dll for make sound (fmod) the next lang, 64bits is 52 kb, with SDL library and the same vector graphics library. the raspberry pi 4 version of the same lang has 35kb (all 64 bits) |
|||
06 Aug 2020, 01:35 |
|
logicx 15 Aug 2020, 18:39
pabloreda wrote: in forth is very common ultra small system, In forth there are no types, just labels with code attached. Everything is a 'cell' which represents the basic data word of any particular architecture. I'm growing a "forth" style interpreter but it's faulting out now - gdb isn't much good for this. |
|||
15 Aug 2020, 18:39 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.