[Vm-dev] Re: Fwd: [Pharo-users] Understanding Slang for building a
compiler to C++
kilon.alios at gmail.com
Tue Mar 8 10:15:57 UTC 2016
Sorry for the late reply, I have been down with the flu lately.
My goal is mostly curiosity , I am itching to try messing with programming
languages but I also like keeping close with smalltalk syntax.
The why is that I am aiming for readable C++ code that is easy to mix with
existing C++ code. In my particular case is using and extending the Unreal
I cannot do it via shared libraries because Unreal Engine is not made to be
used as a library , it actually messes with a lot of things as you can
imagine it has it own event loop, threading, GC and even adds reflection to
C++. Also I need something that compiles statically for the iOS platform
where shared libraries are not allowed, and I am not sure if Android has
So even though its great to use pharo unlimited as a scripting language, I
think there is also usefuleness in limiting pharo usage (static types,
memory managment etc) when you want to generate code in another programming
language in my case C++.
My crazy dream would be that pharo would be able to be used in any project
inside a team, without any other team mates having to learn pharo. The
advantage would be you will be able to use pharo not just for prototyping
but even generate the source in another language and know would be able to
guess you wrote the code in Pharo. Of course this idea is not really new or
However that dream is crazy , my more realistic dream is to build an
enviroment of a collection of tools that allow to annotate pharo code
without changing it, for example you can annotate what type a variable is or
what variable is actually a pointer what kind of pointer (raw or smart)
which method would use C++ templates etc. Then a compiler will take the
pharo code plus the annotations and convert it to C++ code that is readable
as much as possible. That means of course there will be some sever
limitations of how one codes in Pharo in order to translate with ease to
I have been pointed here because you guys are doing something similar with
Slang though I am not sure whether Slang produces readable C code since it
looks like it does not impose any sever limitations to Smalltalk usage but
then I can be wrong.
In any case I am open to advice and suggestions.
View this message in context: http://forum.world.st/Fwd-Pharo-users-Understanding-Slang-for-building-a-compiler-to-C-tp4882613p4883161.html
Sent from the Squeak VM mailing list archive at Nabble.com.
More information about the Vm-dev