7,962 karma · joined January 26, 2009
Previously founder/CTO of Dark (http://darklang.com), and founder/CEO of CircleCI (https://circleci.com). PhD in CS.
https://hachyderm.io/@paulbiggar
https://bsky.app/profile/paulbiggar.com
https://twitter.com/paulbiggar
https://blog.paulbiggar.com
Contact: paul@techforpalestine.org or paul.biggar@gmail.com
I don't remember considering F#, so probably just never occurred to me.
Scala seemed like a mess at the time (from a distance - no idea whether I'm right).
My attempts at Haskell had honestly not gone all that well, the lazyness and pure functional-ness I felt were not great. Basically, I wanted server-side Elm, and OCaml was pretty close.
Tried it, didn't hate it, figured could always do a rewrite later. And here we are.
(standard caveat that benchmarks suck)
[1] https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
There's some really great stuff about OCaml. I don't think we could have gotten through the first 2 years without OCaml, we repeatedly made very large scale changes to what our product was and how it worked, and that would have been 10x harder in something else.
I actually think OCaml stands to be in a great place in the next few years with the work being done by core community members. See https://twitter.com/patricoferris/status/1323330884515356672.
Not only that, but each script automatically runs itself in our docker container so it's fully repeatable. They all start with
. ./scripts/support/assert-in-container "$0" "$@"
which is just this: if [[ ! -v IN_DEV_CONTAINER ]]; then
scripts/run-in-docker "${@}"
exit $?
fi
And this is run-in-docker: https://github.com/darklang/dark/blob/main/scripts/run-in-do...I agree that's quite nice, however updating nested values is very painful.
let a = {a with b = { a.b with c = { a.b.c with d = 5 } } } } e = e.lbl <- value
(I didn't reuse the '=' because two '=' like that looks weird.The main thing I want to address is that a.b.c.d is so much work to write to.
a.b.c.d
but a write is: let a = {a with b = { a.b with c = { a.b.c with d = 5 } } } }
which is much much more verbose than the OO/imperative: a.b.c.d = 5 e{lbl = val}
Though this has been a part of haskell for a while it seems:> Note: e{lbl = val} is the syntax of a standard H98 record update
FSharp, OCaml and Elm have not got great solution here either:
{ e with lbl = value } // ocaml/fsharp
{ e | lbl = value }
Do any functional languages have anything as nice as: e.lbl = valueIt seems to me there's a lot of focus on syntax, and I don't think they've gotten to a great place. For example:
(this Int).square | Int = this.*(this)
In Rust, they do impl Int {
fn square (self) -> Int {
self * self
}
}
I can read the Keli version, but I'm note sure that `(this Int)`, `|`, and `.*` are great inventions. You need a good reason to deviate from commonly recognized syntax, and Keli doesn't feel like it's made things simpler with this.In Dark, we use piping heavily to get the benefits of the dot-syntax. In particular, it can be type directed:
8 |> Int::square |> Int::log 2
The autocomplete will only show you integer functions in this case.For the problem of "which parameter" - our IDE shows parameter names when your cursor is in a position to type the next parameter, so you know what you're adding it is. We also show the parameter names when your cursor is in the completed argument so you know what parameter it is. (I couldn't see if Keli did this, it might not be possible in modern editors).
You should have used a throwaway, not because you have non-politically-correct views, but rather because you hold extremely strong opinions about something you can't even articulate credibly.
I looked up your twitter and saw this from March:
> Despite everything happening I’m still not worried. Corona is a bad flu and the markets will recover. I’m choosing to relax #CoronaOutbreak #relax
Similar confidence, similar ignorance.
In the first case, the hole has a type. I believe this type is inferred by the compiler/editor/type-checker, and I believe it will tell you if they type is wrong (in Dark, we'll tell you if the type is wrong, though we'll still let you put that variable in that hole to support the transition from one valid state to another).
In the configuration file example, you can't change the type: these are statically typed functional languages, and they don't permit "later-time" type changes.
- I can see arenas for a compiler, but I'm not so sure for an interpreter. While most of the memory allocated in Dark will be done within a single HTTP call (and so an arena might actually be appropriate), there are contexts where a GC cycle or two to cleanup might be appropriate. I'm guessing that arena's are an all-or-nothing approach?
- I'm using `im`, which I think also gets in the way of my nice pattern matching, right? Any solutions to that?
Thanks for the feedback. I'm new here, so the advice is appreciated.
I've been using the rule of thumb "does the lifetime of this variable exceed the lifetime of this function" to decide whether to put it in an Rc. Given I'm implementing an interpreter for a GCed language, it seems like I'm pretty much going to have to put everything into an Rc, no? (Another commented mentioned an Arena, but either way it's not the stack).