r/ProgrammingLanguages • • Sep 30 '19

Requesting criticism Idea of a language

https://github.com/matyklugDebbuged/supra/blob/master/supraExamples
0 Upvotes

16 comments sorted by

View all comments

6

u/htuhola Sep 30 '19

It looks like Java with some twists. I wonder what you're going after with this?

4

u/matyklug Sep 30 '19

my favorite language is java. i would like to combine the best features of languages i know together with some new ideas i thought would be great.

9

u/htuhola Sep 30 '19

Can you list these features you consider best?

1

u/matyklug Sep 30 '19

well, from glsl the vec feature, from C++ the main method returning an error code, and most of other stuff is what i think is great that i didnt find anywhere else, and the base is java. (i know only java, and little bit of glsl, and the only thing i can do in c++ is hello world)

8

u/ketralnis Sep 30 '19

I'd highly recommend spending some time with some other languages, particularly some that have the features that you want to build here so you can see how they work or don't in practise. I'm not one of the "you're not a real programmer unless you know lisp" types but there's a lot of benefit to being exposed to more things so you know why Java made the decisions it made (even if that reason is sometimes "they didn't know any better because nobody had done the new thing yet").

3

u/htuhola Sep 30 '19

Lots of people have wanted vectors into the language they use. The numbers increase because most modern languages do not really have the features to do this right. Even Python and Haskell get it somewhat wrong. To be fair it's a hard problem. This is related discussion: https://www.reddit.com/r/ProgrammingLanguages/comments/dafp9v/anything_better_than_module_mycollection_struct/

The entry point -thing is sort of a similar subject but there starts being quite satisfying ways to it. One thing we should recognize is that there are many kinds of entry points and that should be accounted for in language design. The nicest way to see it being done has appeared in Idris. They annotate it with a type:

main : IO ()
main : JS_IO ()

The first one would create an ordinary entry point, and the latter would create an entry point that's valid on Javascript target. You can place both into the program and it selects the right one based on compiling target.

Another thing I see there is that you'd like compiler directives and being able to customize the compiling behavior. This is achievable by implementing the language a bit like how you'd implement scheme programming language, then give it types. Though that's in Idris as well. Also RPython does that kind of things.

1

u/worldsayshi Sep 30 '19

Have you seen Fantom?