Live data from Hacker News

Lang Jam: create a programming language in a weekend

github.com

81–90 of 135 posts

Re: Lang Jam: create a programming language in a weekend

#82
post #23

What 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]

I'm dubious about the order of operations here.

Re: Lang Jam: create a programming language in a weekend

#83
You can code in any programming language you'd like to create your project, so long as the language is part of the Debian/Ubuntu or Arch package repo (or one of the language-specific repos, like Rust's cargo). Please limit build steps of the project to three or less steps.

Re: Lang Jam: create a programming language in a weekend

#84
post #16
post #13

Earlier quoted context omitted.

Or a Lisp and let the user face them instead.

Forth seems easier to do over a weekend, though.

There's even a recipe posted in a couple of comments here:

https://news.ycombinator.com/item?id=13082825

I followed that guide to implement a simple FORTH-like system in golang:

https://github.com/skx/foth

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

#88
post #30
post #23

What 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…

[deleted]

Re: Lang Jam: create a programming language in a weekend

#89
post #23

What 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…

Seems pretty readable to me if you’re comfortable with Haskell.

Re: Lang Jam: create a programming language in a weekend

#90
post #68
post #48

Earlier 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

Swift is more like C# or Java than Rust. It's more like adapting C# to the objective C runtime than Rust.

It's also not memory safe. It's very easy to crash the process.

Post reply on HN