JavaScript was made in a weekend, wasn't it?
Lang Jam: create a programming language in a weekend
81–90 of 135 posts
Re: Lang Jam: create a programming language in a weekend
#82What kind of language ideas do you folks have? What would your fizzbuzz look like? I'm not sure I've ever seen a more readable compact fizzbuzz than this version in coffeescript ['fizz' unless i%3] + ['buzz' unless i%5] or i for i in [1..100]
Re: Lang Jam: create a programming language in a weekend
#83Re: Lang Jam: create a programming language in a weekend
#84Earlier quoted context omitted.
Or a Lisp and let the user face them instead.
Forth seems easier to do over a weekend, though.
https://news.ycombinator.com/item?id=13082825
I followed that guide to implement a simple FORTH-like system in golang:
As I was following the implementation recipe I broke it down into "educational steps". Although it isn't a true FORTH it is pretty easy to understand and useful enough to embed inside other applications.
Now and again I consider doing it again, but using a real return-stack to remove the hardcoded control-flow words from the interpreter, but I never quite find the time.
Re: Lang Jam: create a programming language in a weekend
#85Maybe I'm not reading correctly, but it seems the project is about making a language compiler and not a language itself?
Re: Lang Jam: create a programming language in a weekend
#86Re: Lang Jam: create a programming language in a weekend
#87Re: Lang Jam: create a programming language in a weekend
#88What kind of language ideas do you folks have? What would your fizzbuzz look like? I'm not sure I've ever seen a more readable compact fizzbuzz than this version in coffeescript ['fizz' unless i%3] + ['buzz' unless i%5] or i for i in [1..100]
Another "crazy" idea: I'd like the compiler to reformat code to match strict style conventions. Why? Sometimes there's no "right" style. Sometimes novices need training wheels. In the long run, style doesn't matter, but in big projects code is easier to read when style is consistent. It's also easier to onboard when code follows industry-standard styles. Would it be better when a language gently pushes everyone to th…
Re: Lang Jam: create a programming language in a weekend
#89What kind of language ideas do you folks have? What would your fizzbuzz look like? I'm not sure I've ever seen a more readable compact fizzbuzz than this version in coffeescript ['fizz' unless i%3] + ['buzz' unless i%5] or i for i in [1..100]
My favourite FizzBuzz is in Haskell, I found it in this talk by Kevlin Henney[0], and looks like this: fizzes = cycle ["", "", "Fizz"] buzzes = cycle ["", "", "", "", "Buzzes"] words = zipWith (++) fizzes buzzes numbers = map show [1..] fizzbuzz = zipWith max words numbers Henney explains in detail in the video, but it makes use of lazy evaluation to create an infinite list of FizzBuzzes, and also uses no if statemen…
Re: Lang Jam: create a programming language in a weekend
#90Earlier quoted context omitted.
I'd like a GC (no borrow checker) version of Rust. There's so many cool concepts in the language that I'd like to know how useful it is in different contexts. (Compiled without a VM, option types, no nulls, easy error handling without exceptions...)
You just essentially described Swift
It's also not memory safe. It's very easy to crash the process.