As someone that writes a lot in Rust, I have a longstanding dream to make a compiler for a subset of the language, since I don’t use all features of Rust and my hope is that this way I could have fast debug builds (in terms of compilation time) while I develop, with simplified borrow checker and so on. So then I can iterate faster. That’s one of my dreams. But I have not had time to even look at it yet, as the other…
Lang Jam: create a programming language in a weekend
51–60 of 135 posts
Re: Lang Jam: create a programming language in a weekend
#52What 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 would build around a constrained high-level concept. Something like actors, perhaps. It would be assembly-like, command-oriented. I would then build a visualization environment which shows what the actors are doing, possibly step-by-step. It would show them moving values between registers and buffers. It would show messages passing between actors. It would show new actors create and finished actors die and errors g…
Re: Lang Jam: create a programming language in a weekend
#53What 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…
Edit: Nevermind, max is lexicographic, not based on string length. Brain fart.
Re: Lang Jam: create a programming language in a weekend
#54What 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'd like a language that makes it easy to mock and dependency inject without doing anything special. IE, if in my business logic, I write "new Foo()", I'd like to be able to write a unit test where I say something like, "whenever I wrote 'new Foo()' swap in this mock object instead." Or, in a module that's an entry-point, I'd like to say, "whenever I wrote 'new Foo()' swap in this subclass instead." I've spent so muc…
If you have a function like:
(defn send-mail [receiver-ids title text]
...)
You can mock it out in your tests like: (with-redefs [send-mail (fn [r-ids title text]
(println r-ids title text))]
;; send-mail will just print
...)
[0] https://clojuredocs.org/clojure.core/with-redefsRe: Lang Jam: create a programming language in a weekend
#55What 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
#56Earlier 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 could try OCaml (it does have exception but they're usually "opt in"), it's a really nice language and probably one of the closest to GC'd Rust. There's also Swift that inspired some features.
Re: Lang Jam: create a programming language in a weekend
#57As someone that writes a lot in Rust, I have a longstanding dream to make a compiler for a subset of the language, since I don’t use all features of Rust and my hope is that this way I could have fast debug builds (in terms of compilation time) while I develop, with simplified borrow checker and so on. So then I can iterate faster. That’s one of my dreams. But I have not had time to even look at it yet, as the other…
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...)
Re: Lang Jam: create a programming language in a weekend
#58What 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'd like a language that makes it easy to mock and dependency inject without doing anything special. IE, if in my business logic, I write "new Foo()", I'd like to be able to write a unit test where I say something like, "whenever I wrote 'new Foo()' swap in this mock object instead." Or, in a module that's an entry-point, I'd like to say, "whenever I wrote 'new Foo()' swap in this subclass instead." I've spent so muc…
Neither is popular but they're pretty interesting!
Re: Lang Jam: create a programming language in a weekend
#59Earlier quoted context omitted.
You could try OCaml (it does have exception but they're usually "opt in"), it's a really nice language and probably one of the closest to GC'd Rust. There's also Swift that inspired some features.
OCaml is often dropped due to its unpredictable performance
Re: Lang Jam: create a programming language in a weekend
#60Earlier quoted context omitted.
You could try OCaml (it does have exception but they're usually "opt in"), it's a really nice language and probably one of the closest to GC'd Rust. There's also Swift that inspired some features.
OCaml is often dropped due to its unpredictable performance