Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
slightknack
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
10 ms
·
31.
▲
by
slightknack
6y ago
Under the hood I'm going to use Rust `Vec<T>`s to represent lists, so it'd be trivial to provide a FFI operation to append something to the end in constant time. However, we can treat the list like a linked list, and, using
32.
▲
by
slightknack
6y ago
Right, so there would have to be built in functions that mutate and return an object. So, for instance, one might be: List::replace list index value -> list List would just write to the `list` it is given. If `list` is a CoW ref
33.
▲
by
slightknack
6y ago
Ah, It seems like like my #!/bin/sh suspiciously supports bash features... I'll have to update the install script. Thanks for pointing that out!
34.
▲
by
slightknack
6y ago
So Passerine has a record type, and is row-polymorphic. Names keyword arguments in passerine would look like: draw_arc { x: 3, y: 5, radius: 10, start: 0, end: 2 * 3.142, }
35.
▲
by
slightknack
6y ago
Something interesting is partial application. Say you have a function that takes two arguments: add = a b -> a + b This is really equivalent to: add = a -> b -> a + b Which in turn is equivalent to: add = a
36.
▲
by
slightknack
6y ago
Thanks for discussing this with me and helping me work through it. To answer your question: Let's annotate the variable lifetimes. `'` indicates last use, `_n` indicates that a variable holds the same value. I'll only be anno
37.
▲
by
slightknack
6y ago
> Comments should explain the why, not the what or the how. Obviusly that are exceptions, almost all of them around the really algorithmic parts of the code, something I have to write less than once per year (backend software is not that
38.
▲
by
slightknack
6y ago
What operating system do you have? It seems like your `read` command does not support the `-n` argument - but that's not the point, I really need to work on removing installation friction. If you have git and cargo installed (needed an
39.
▲
by
slightknack
6y ago
I'm working on a blog post on the subject, but this is something that needs more justification than an HN comment. To answer your questions: > What's a "copy-on-write reference"? A copy on write reference (CoW) is a p
40.
▲
by
slightknack
6y ago
I think the README addresses this question well, if you're familar with Haskell and know what to look for. The main differences are the macro and the fiber system for metaprogramming and concurrency respectively; Passerine aims to keep
41.
▲
by
slightknack
6y ago
Oh, I think I just confused refinement types with dependent types. The above still stands though.
42.
▲
by
slightknack
6y ago
I'm no type theory expert, but if you can describe natural numbers as: Even (n: Natural) | n % 2 == 0 Then what's stopping you from doing: Undecidable _ | loop {} I'm not sure, but I think that's becaus
43.
▲
by
slightknack
6y ago
I've found that most small crates can be replicated in an afternoon. It's much more fun (and performant!) if you do it yourself. :)
44.
▲
by
slightknack
6y ago
The core language has no dependencies, and can compile to wasm, so it's on the docket.
45.
▲
by
slightknack
6y ago
Thanks! <3
46.
▲
by
slightknack
6y ago
That's because Passerine is in a bit of a transition zone. It's dynamically typed right now, but it will be statically typed in the future (the next release actually, fingers crossed). See the FAQ section of the README for more in
47.
▲
by
slightknack
6y ago
My goal was to replicate lisp without the redundant parenthesis. There are a few conventions common in lisp: expressions usually occur on a new line, blocks begin with, well, `begin`, there is spacing between definitions, macros operate on
48.
▲
by
slightknack
6y ago
'roughly' ;)
49.
▲
by
slightknack
6y ago
Any type system with dependent types (`where` in Passerine) is undecidable, meaning error reporting for these types has to be moved to runtime. There's a quote from someone somewhere, and it goes something like this: > Ocaml is stil
50.
▲
by
slightknack
6y ago
This is actually something I've been thinking about a lot! I'm not sure about the time frame, but ideally `passerine` (the crate) would provide a derive macro (similar to serde) that could serialize Rust structs to passerine, and
51.
▲
by
slightknack
6y ago
I'm currently thinking of ways to make macros that serialize Rust structs to Passerine values (and vice-versa) a la serde. I think being able to hack out an API in a high-level language and then tossing it down to something like Rust f
52.
▲
by
slightknack
6y ago
I understand the issue with conciseness and readability. I think comments are underappreciated when writing code: not only can you explain what some code does, but how it does it, and why it does it that way. This doesn't have to b
53.
▲
by
slightknack
6y ago
I'm glad you found the langauge interesting! I actually started Passerine after reading Bob Nystrom's blog posts on concurrency and iteration (Iteration, Inside and Out). At the time, I was also reading through the thesis on Erlan
54.
▲
by
slightknack
6y ago
Hey, author of this language here. I love Rust, but what I like the least about `panic!` is the lack of context it provides. I mean, sure, there's `RUST_TRACEBACK=1`, but that's not nearly as neat as a real traceback, with the a
55.
▲
Can You Find This Man? (video)
(youtube.com)
1 points
by
slightknack
6y ago
|
0 comments
56.
▲
by
slightknack
6y ago
Not currently, but I don't see why not - the core language is a simple zero-dependency binary.
57.
▲
by
slightknack
6y ago
Thanks for the encouragement! There is so much more I want to explore :)
58.
▲
by
slightknack
6y ago
Hey HN, Isaac Clayton here! I'm nervous yet very excited to share an early preview of a novel programming language I've been developing for the past year or so. Passerine is an functional scripting language , blending the rapid
59.
▲
Show HN: Passerine – an extensible programming language – v0.8.0 released
(github.com)
22 points
by
slightknack
6y ago
|
8 comments
60.
▲
MathURLs – World's simplest math news aggregator
(mathurls.com)
2 points
by
slightknack
6y ago
|
0 comments
More ›