Those are interesting languages and probably better ideas than what I am
thinking. However they are not what I am talking about.

The language I am making is called "Magnatar"

Magnatar is not Smalltalk, but it is a Smalltalk trojan horse.

My main goals are

1) Create 100% readable C code, code that it looks like it was written by a
person and not automatically generated , leaving no room for suspicion
2) Keep as close to Smalltalk as I can
3) Map to C syntax , one to one
4) Implement a loose variant of OOP
5) Powerful macro system for source manipulation without the need for
header files
6) CMake integration (automate building which a headache in C/C++)

Essentially I am trying to make a language that can allow a smalltalker to
write C in Smalltalk and none noticing that he did. Hence why I talked
about a trojan horse. I got the live coding part covered already but I
would also like to use Pharo as the IDE of the language if I can. Also
because of (3) Magnatar will be purely statically typed not because I have
any love for static types but because it makes (3) far easier to
accomplish. So Magnatar wont be a Smalltalk implementation neither a
replacement for it.

This means also that Magnatar will be a way to extend Pharo on low level.
Writting  readable C using Smalltalky syntax for extensions instead of just
writting in C and then using Pharo's UFFI. Of course this will benefit
those that want to squeeze much more performance out of Pharo.

Magnatar also is not another language trying to take over the world but a
language I will use to write C code for a project I am working on which is
3d graphics and I need the full performance. So in the end it will be a
personal language.

Unfortunately this means no dynamic types at all, no GC , no VM, no
bytecodes, not intepretation of any sort, no image format. The only thing I
am keeping will be live coding. Also OOP will be basically super simple,
only c structs and c functions with a small API to allow you to "compose"
objects similarly to prototype based OOP but I am considering some syntax
for basic classes also. Again all these are under the prime goal of 100%
readable idiomatic C code. The rule is simple "if it cannot easily map to C
, it wont get in". So this is a highly focused language.

I have not found yet a language that compiles to readable C code although
there a lot of them that compile to unreadable C (nim, ECL, chicken scheme,
etc).

On Wed, Oct 17, 2018 at 8:37 AM H. Hirzel <hannes.hir...@gmail.com> wrote:

> The successor of Ni is 'Spry'
>
> https://github.com/gokr/spry
> http://sprylang.se/
>
> "Spry borrows homoiconicity from Rebol and Lisp, free form syntax from
> Forth and Rebol, the word of different types from Rebol, good data
> structure literal support from JavaScript and the general coding
> experience and style from Smalltalk. It also has a few ideas of its
> own, like an interesting argument passing mechanism and a relatively
> novel take on OO."
>
> --Hannes
>
> On 10/17/18, Ben Coman <b...@openinworld.com> wrote:
> > Have you looked at Ni?  (I only read about it)
> > http://goran.krampe.se/2015/09/16/ni-a-strange-little-language/
> >
> > cheers -ben
> >
> > On Wed, 17 Oct 2018 at 03:45, Dimitris Chloupis <kilon.al...@gmail.com>
> > wrote:
> >
> >> Thank you Thierry , that was exactly what i was looking for :)
> >>
> >> On the subject of syntax, StrongTalk looks far more advanced compared to
> >> what I am aiming which is basically writting C code with Smalltalk like
> >> syntax. I am looking at this
> >>
> >> http://bracha.org/nwst.html
> >>
> >> Which describes some really impressive features. So I am aiming only for
> >> source to source compiler and not implementation of complex systems for
> >> incremental compilations , optional type system etc.
> >>
> >> On parsing strange code that is not much of an issue cause the project I
> >> am working on has pretty reasonable code and will probably offer a way
> to
> >> inline c code in case the parser fail. In any case my goals are small ,
> >> cause I dont have resources for complex implementations. Its also a
> >> language that will be designed solely for my needs and be offered open
> >> source for anyone else that may find it useful. In any case I am sure I
> >> will have many questions to ask :)
> >>
> >> I was looking into ANTLR , since the book I am reading on language
> design
> >> is using ANTLR but I rather implement this in Pharo. I used SmaCC when I
> >> was working for my Python bridge and I really liked it , mostly because
> >> it
> >> offers ready made syntax definitions for most popular languages. Which
> >> makes my life a lot easier.
> >>
> >>
> >> On Tue, Oct 16, 2018 at 9:45 PM Thierry Goubier
> >> <thierry.goub...@gmail.com>
> >> wrote:
> >>
> >>> Hi Dimitris,
> >>>
> >>> Le 16/10/2018 à 19:39, Dimitris Chloupis a écrit :
> >>> > yes i already said that i followed the instructions in the github
> repo
> >>>
> >>> Yes, by default that installation of SmaCC does not load all parsers
> >>> (some of them are fairly large). However, most of them are in the
> >>> downloaded repository, so you can load them independently.
> >>>
> >>> Otherwise, loading that way, should load everything:
> >>>
> >>> Metacello new
> >>>            baseline: 'SmaCC';
> >>>            repository: 'github://SmaCCRefactoring/SmaCC';
> >>>            load: #('Tools' 'Examples' 'Examples-Extra')
> >>>
> >>> Regarding your language question, I'd suggest two things:
> >>>
> >>> - Look at StrongTalk for a way to write Smalltalk with type
> >>> declarations...
> >>>
> >>> - C parsers able to parse most strange C code one may encounter takes
> >>> some work...
> >>>
> >>> Regards,
> >>>
> >>> Thierry
> >>>
> >>> > On Tue, Oct 16, 2018 at 8:18 PM H. Hirzel <hannes.hir...@gmail.com
> >>> > <mailto:hannes.hir...@gmail.com>> wrote:
> >>> >
> >>> >     Refers to
> >>> >     https://github.com/SmaCCRefactoring/SmaCC
> >>> >
> >>> >     which says
> >>> >
> >>> >           This is the port for Smalltalk/Pharo 1.3, 2, 3, 4, 5 and 6.
> >>> >
> >>> >
> >>> >     Installing a Development version of Pharo for the latest Pharo
> >>> > (with
> >>> >     no guarantees):
> >>> >
> >>> >     Metacello new
> >>> >          baseline: 'SmaCC';
> >>> >          repository: 'github://SmaCCRefactoring/SmaCC';
> >>> >          load
> >>> >
> >>> >     On 10/16/18, H. Hirzel <hannes.hir...@gmail.com
> >>> >     <mailto:hannes.hir...@gmail.com>> wrote:
> >>> >      > What about trying
> >>> >      >
> >>> >      >
> >>> >      >     Metacello new
> >>> >      >     baseline: 'SmaCC';
> >>> >      >     repository: 'github://ThierryGoubier/SmaCC';
> >>> >      >     load
> >>> >      >
> >>> >      > This worked in Pharo 6.1 in November 2017
> >>> >      >
> >>> >      > On 10/16/18, Dimitris Chloupis <kilon.al...@gmail.com
> >>> >     <mailto:kilon.al...@gmail.com>> wrote:
> >>> >      >> thanks for the info Peter , will give it a try :)
> >>> >      >>
> >>> >      >> On Tue, Oct 16, 2018 at 7:35 PM PBKResearch
> >>> >     <pe...@pbkresearch.co.uk <mailto:pe...@pbkresearch.co.uk>>
> >>> >      >> wrote:
> >>> >      >>
> >>> >      >>> Dimitris
> >>> >      >>>
> >>> >      >>>
> >>> >      >>>
> >>> >      >>> If you download the latest Moose Suite 6.1, you will have
> >>> > Pharo
> >>> >     6.1 with
> >>> >      >>> lots of extra packages, including SmaCC. The SmaCC includes
> >>> >     compilers
> >>> >      >>> for
> >>> >      >>> C, Smalltalk and Java, among others, but with little or no
> >>> >      >>> documentation.
> >>> >      >>> I
> >>> >      >>> am not a SmaCC expert, so I can’t say whether it will do
> what
> >>> >     you want,
> >>> >      >>> but
> >>> >      >>> at least it will give you a start. Moose also includes
> >>> >     PetitParser and
> >>> >      >>> PP2,if you want to try other parsing approaches. Of course,
> >>> > the
> >>> >     Windows
> >>> >      >>> version is 32-bit only, for reasons explained elsewhere in
> >>> > this
> >>> >     thread.
> >>> >      >>>
> >>> >      >>>
> >>> >      >>>
> >>> >      >>> HTH
> >>> >      >>>
> >>> >      >>>
> >>> >      >>>
> >>> >      >>> Peter Kenny
> >>> >      >>>
> >>> >      >>>
> >>> >      >>>
> >>> >      >>> *From:* Pharo-users <pharo-users-boun...@lists.pharo.org
> >>> >     <mailto:pharo-users-boun...@lists.pharo.org>> *On Behalf Of
> >>> >      >>> *Dimitris
> >>> >      >>> Chloupis
> >>> >      >>> *Sent:* 16 October 2018 15:40
> >>> >      >>> *To:* Any question about pharo is welcome
> >>> >     <pharo-users@lists.pharo.org <mailto:pharo-users@lists.pharo.org
> >>
> >>> >      >>> *Subject:* [Pharo-users] Installing SmaCC
> >>> >      >>>
> >>> >      >>>
> >>> >      >>>
> >>> >      >>> Hey guys
> >>> >      >>>
> >>> >      >>>
> >>> >      >>>
> >>> >      >>> I downloaded the latest Pharo 6.1 64bit for Windows and
> tried
> >>> >     to install
> >>> >      >>> SmaCC through the catalog browser but it failed
> >>> >      >>>
> >>> >      >>>
> >>> >      >>>
> >>> >      >>> I did manage to install it following the instruction in the
> >>> >     github repo
> >>> >      >>> but I see that I am missing most parser packages.
> >>> >      >>>
> >>> >      >>>
> >>> >      >>>
> >>> >      >>> The languages I am interested are Smalltalk (which is
> >>> > included)
> >>> >     and C
> >>> >      >>> (if
> >>> >      >>> possible C++ too) cause I will be creating a new language
> >>> > which
> >>> >     will be
> >>> >      >>> a
> >>> >      >>> cross between C and Smalltalk (very similar to smalltalk
> >>> > syntax
> >>> >     but with
> >>> >      >>> the addtion of C types and no GC and dynamic typing and also
> >>> > a
> >>> >     partial
> >>> >      >>> implementation of OOP that is quite diffirent). My goal is
> >>> >     compilation
> >>> >      >>> of
> >>> >      >>> my language to readable C code so the ability to parse also
> >>> >     existing C
> >>> >      >>> code
> >>> >      >>> is needed.
> >>> >      >>>
> >>> >      >>>
> >>> >      >>>
> >>> >      >>> Any help is greatly appreciated , thanks :)
> >>> >      >>>
> >>> >      >>
> >>> >      >
> >>> >
> >>>
> >>>
> >>>
> >
>
>

Reply via email to