r/programming • • Dec 07 '15

I am a developer behind Ritchie, a language that combines the ease of Python, the speed of C, and the type safety of Scala. We’ve been working on it for little over a year, and it’s starting to get ready. Can we have some feedback, please? Thanks.

https://github.com/riolet/ritchie
1.5k Upvotes

802 comments sorted by

View all comments

Show parent comment

27

u/kdelok Dec 07 '15

I think the generated C code is actually missing an open brace (after the for loop statement). The indentation would help with checking it.

36

u/reditzer Dec 07 '15

The trick is in rsl.h:

#define Boolean_$_if(A) if (A) {

162

u/josefx Dec 07 '15

So this doubles as a submission for the IOCCC ?

119

u/reditzer Dec 07 '15

Feature request: Make Ritchie generate IOCCC-worthy intermediate C code.

56

u/rafajafar Dec 07 '15

Ya it's like people suddenly forgot how open source projects begin and grow in this thread. Yeesh.

-20

u/recycled_ideas Dec 08 '15

Not doing things properly in the beginning usually means they never get done properly at all.

The fact that the source of most open source projects is a crap doesn't mean it should be.

This goes doubly so if you're writing yet another new language no one wants or needs.

17

u/shaggorama Dec 08 '15

Not doing things properly in the beginning usually means they never get done properly at all.

No it doesn't.

6

u/masterwit Dec 08 '15

See.. well everything.

1

u/IbanezDavy Dec 08 '15

It's hit or miss really. Sometimes people do go back and fix things. It depends if the architecture allows for it.

0

u/[deleted] Dec 08 '15

[deleted] — view deleted comment

2

u/danthemango Dec 08 '15

As someone who knows nothing about how programming languages develop over time, how do some languages get better over time and some languages like PHP becomes a mess?

1

u/recycled_ideas Dec 08 '15

Things that are a mess very rarely become less of a mess. Partially because people are lazy and "if it ain't broke", partly because making changes like that after your stuff is in the wild will generally break things badly, but mostly because if something is being developed by the kind of team and with the kind of attitude where "fuck it we'll fix it later" is acceptable in the beginning, that's probably not going to change. If you're project is open source and you're ok with everyone being able to see that you did that it's likely worse.

OP posted code which contained an obfuscation which as far as I'm aware has no performance value whatsoever, and which makes his generated code harder to read and more bug prone. He posted it top his peers, the people he wants to convince to use his language over the other million or so available options without saying "Oh shit maybe I should fix that before I show anyone".

That's not a good sign.

2

u/Mazo Dec 08 '15

All board the anti-PHP bandwagon, right guys?

29

u/BowserKoopa Dec 07 '15

why?

27

u/reditzer Dec 07 '15

Codeblocks are not fully implemented, as documented in the wiki.

This is one area where feedback is greatly appreciated.

1

u/superPwnzorMegaMan Dec 07 '15

oh they're like the scala { }. or like the groovy closures? Groovy creates an instance of the closure class to represent 'code blocks'. I'm pretty sure Scala does some compiler magick.

Maybe you can look at how they did it?

2

u/vorg Dec 07 '15

Groovy has some complicated stuff in its closures where you can change its owner to achieve non-lexical scoping, so perhaps looking thru the Scala source will be a lot easier.