harryposner
Joined 7 years ago
Joined 7 years ago
The version with a threading macro, will create a lazy-sequence for each step in the pipeline. It will not instantiate the entire list, so it's O(1) memory overhead in terms of peak memory, but it churns O(N) extra garbage.
(->> things
(map model/find-thing)
(filter some?))
And the version with transducers, which will not create any intermediate sequences: (sequence (comp (map model/find-thing)
(filter some?))
things)
It looks like there's a Common Lisp transducers library, but I have no idea how widely it's used.Yep— this is how you can implement the `amb` operator with call/cc: https://ds26gte.github.io/tyscheme/index-Z-H-16.html
[Lucas 1988] https://home.uchicago.edu/~vlima/courses/econ203/fall01/Luca...
For me, coming from writing Clojure with Neovim + vim-sexp + vim-fireplace, I would need Paredit and REPL integration.
Paredit is doable with Treesitter, and I'm actually really excited about Helix's Treesitter integration--- every time I write a non-Lisp language, I miss structural editing, so it'll be nice for other languages catch up to Lisp on that front. It doesn't really look like it's quite there yet, though. The built-operations that use Treesitter are spare [0], and while you could implement operations like promote, slurp, and barf with them, you'd have to clobber some register. I don't see at all how you could implement splice without an actual language, since you would need a way to select all siblings of the current node.
REPL integration absolutely needs a plugin language. Unlike the LSP, there isn't a standard protocol for communicating with a REPL, so each language requires its own REPL client. Unless they want to ship a REPL client for every language under the sun, they'll have to provide some way for users to implement their own clients. That said, every time I look at Conjure, they've added REPL clients for more and more languages [1], so maybe it is feasible to have it built into the editor.
> A powerful programming language is more than just a means for instructing a computer to perform tasks. The language also serves as a framework within which we organize our ideas about processes. Thus, when we describe a language, we should pay particular attention to the means that the language provides for combining simple ideas to form more complex ideas. Every powerful language has three mechanisms for accomplishing this:
> * primitive expressions, which represent the simplest entities the language is concerned with,
> * means of combination, by which compound elements are built from simpler ones, and
> * means of abstraction, by which compound elements can be named and manipulated as units.
Brainfuck is missing any sort of means of abstraction. The primitives are instructions, and the only means of combination is writing instructions in sequence, but there's no way in the language to refer to any sequence of instructions --- no functions, no subroutines, not even labels. This makes it utterly useless as a way to organize your thoughts on how to compute something.
[0] http://sarabander.github.io/sicp/html/1_002e1.xhtml#g_t1_002...
user=> (rest '(3 . 4))
(. 4)
user=> (second '(3 . 4))
.
user=> (nth '(3 . 4) 2)
4There is exactly such a rule. See the FIDE Laws of Chess [0], rule 9.6.1.
[0] https://pandas.pydata.org/pandas-docs/stable/reference/api/p...
The group messages were the biggest problem, and that's what made me give up, but there were some other issues:
- Shared links showed up as "Website: Short description (example.com)" and didn't include the URL
- Images weren't shown at all
I might take a look and see how blueferry handled those limitations.
[blueferry doc] https://github.com/erikwb/blueferry/blob/main/PROTOCOL.md
[inspiration] https://news.ycombinator.com/item?id=23411520#23413394
[Bluetooth MAP standard] https://www.bluetooth.com/specifications/specs/message-acces...