Draco-lang / Language-suggestions

Collecting ideas for a new .NET language that could replace C#
75 stars 5 forks source link

Start uploading code samples to the repo from the Discord server #88

Closed LPeter1997 closed 1 year ago

LPeter1997 commented 1 year ago

On the Discord server we have started accumulating snippets to demonstrate the language. I believe the simpler ones could be uploaded here to provide more code samples for newcomers.

thinker227 commented 1 year ago

The current sampels from the server are the following:

Which of these should we actually include? Some like the truth machine, recursive Fibonacci, Fizz Buzz / with pattern matching, and 99 Bottles of Beer demonstrate simple and practical usage of the language, while ones like modular arithmetic doesn't do a very good job of appearing as something you'd use in practice. The TODO API samples are great but I'm wondering if they're a little too advanced for this purpose, granted you mention only including the "simpler ones".

LPeter1997 commented 1 year ago

I'd agree, let's keep the simple ones - meaning the API samples should be excluded. The modular arithmetic one is debatable, its purpose is to showcase the type system and operators more than anything else.

thinker227 commented 1 year ago

The question is who these samples should be directed towards and what their purpose is, to showcase the language and all its features, or examples of how to practically use it? The modular arithmetic example does a good job of demonstrating that feature, but the code itself is not something you'd use in practice.

LPeter1997 commented 1 year ago

I'd say the purpose can be both, they are samples of the language in a repo where we write the language specification.