#2734 Fantom as a standalone language?

Ilove:= Tue 12 Feb

By standalone I mean something like CPython or PyPy which has it own interpreter, GC and JIT compiler that interpreting directly to machine code and not depends on third party vm like jvm or node like Fan does now. Do it reasonable? Correct me if I'm wrong. Thanks.

SlimerDude Tue 12 Feb

If you're talking about a standalone Fantom virtual machine that runs fcode natively then I think ChunqueDong is writing one in C++ - see FanRun on GitHub for details:

FanRun - The VM for Fanx/Fantom programming language

Ilove:= Tue 12 Feb

I think I means something like CPython interpreter or PyPy JIT-er rather another virtual machine. It run the source file as script and not require any intermediate format like fcode or bytecode. As the source already available (most successful languages and frameworks had to be open source) and the source is pure Fantom so no need to interop with any language (assuming the ecosystem complete enough to not rely on third party Java based library) although the ability to call C library functions is great. Something like another Python but Fantom syntax.

In case of you don't want the source to be open you can use obfuscater so no one can read it.

SlimerDude Tue 12 Feb

You can run Fantom files as a script direct from the command line, see Running Fantom Scripts:

$ HelloWorld.fan

It's support is fairly limited, though I have thought about extending the using statement to import other Fantom source files.

Ilove:= Tue 12 Feb

@SlimerDude: I already know that, but Fan has to depends on JVM to run itself, fan is a .bat file on Windows or .sh file on Unix that actually call a .jar file.

Perhaps I'm really wrong because my suggestions have no benefits to Fan so far or made my works easier. When we want Python, just use Python. Fan is not Python.

If someday Fan could run on another lightweight virtual machine (the jvm is big) it's awesome. Chungquedong's project looks promising but it's just a prototype now full of temporal hacks. Time will answer us.

Login or Signup to reply.