r/Forth • • Dec 19 '18

What is NOT a stack machine?

https://github.com/udexon/5CSM/blob/master/SMOCL/README.md
0 Upvotes

8 comments sorted by

4

u/protoUbermensch Dec 19 '18

Lisp is not a stack machine.

2

u/jephthai Dec 20 '18

It's a tree machine, maybe.

3

u/ummwut Dec 19 '18

Absolute wall of text. What even is the topic?

2

u/frogsun Dec 21 '18

Can this convert Forth code to OpenCL? Not sure why you would want to write code on a mobile phone, it was difficult enough typing this comment.

1

u/_crc Dec 21 '18

It doesn't look like it has a parser, just some additional functions and wrappers for using a stack within a C+OpenCL application as illustrated by the main() function:

int main(void) {
    int *A, *B;

    // SMOCL();
    SMOCL1a(&A, &B); // 2 in 2 out? put both on stack?
    // f_malloc, f_fill 0 to 1024?, then dup array? or use clVect?
    // need new function, fill array from 0 to N
    // then next function need to transfrom clVect to array?

    // head = f_(head, &A, &B); need parameters for malloc
    SMOCL1b(A, B);

    // head = f_(head); no need parameters, already on stack
    FD();
}

Coding on a mobile phone isn't easy, but my kids seem to do ok with it. One of them has been writing a small game in Python, using SceneKit via a module allowing bridging to Objective-C. I have a harder time without a physical keyboard, but over the last few months have learned to use the virtual one on an iPad enough that I can write modest length programs in Forth, C, and Python using it.

1

u/gousey Dec 22 '18

Why not use the Bluetooth interface to a real wireless keyboard?

1

u/_crc Dec 22 '18

I do use a physical keyboard (using a lightning to usb adapter) when at work or my home office. But it's not really portable. Due to severe RSI issues I use only split, ergonomic keyboards; I've not found a Bluetooth ergo keyboard that I like yet.

1

u/wean_irdeh Dec 20 '18

I like this. Keep it up!