Earlier quoted context omitted.
First I've heard of Red. Does it implement 'readable' [1] or is it a [parallel school of thought] (can't think of right phrase here but you get what I mean)? Also has anyone tried to create a 'readable' [1] flavour of Clojure yet? If not, why is that, do lispers consider all the parens to really not be a barrier? [1] http://readable.sourceforge.net/
>Does it implement 'readable' Nope, it has it's own notation which I find very close to the Smalltalk one, for example: red>> a: [1] == [1] red>> pick head append a 1 + 1 2 == 2 red>> a == [1 2] So the second expression is good example of how things work, this is how it looks if I put parens (which are unnecessary in this case): pick (head (append a (1 + 1))) 2 Here interpreter/compiler knows how many arguments each…
Pixie – A small, fast, native Lisp
151–160 of 164 posts
Re: Pixie – A small, fast, native Lisp
#152Earlier quoted context omitted.
Floppy disks were well on their way out, and people were still complaining about a 2 MB footprint.
I thought Smalltalk's hayday was early-mid 80s. That would imply 5.25" floppies would still be in use and 3.5" floppies overtaking them circa 1988.
My involvement with Smalltalk started in the 90's. Then it still had high penetration in the Fortune 500, and it was a niche language for complex financial programs. It was also used in Energy.
Re: Pixie – A small, fast, native Lisp
#153Earlier quoted context omitted.
I'll give you another. Laziness. It's built in. It's trivial to create lazy lists that generate their contents as you walk down the list. Even infinite lazy lists. The list of all prime numbers. The list of all fibonacci numbers. You can use map, which if I remember my CL, is like MAPCAR. But instead of map, you can use pmap which will do the processing on all of your cpu cores.
pmap in CL is one library away, along with preduce, ... ( https://lparallel.org/ ).
Re: Pixie – A small, fast, native Lisp
#154Earlier quoted context omitted.
A big one is persistent data structures. Where 'persistent' may not mean what you think it means. In Clojure it is impossible to surgically modify a data structure. That is, you can't do something like: (SETF (CAR (CDR x)) 'foo) which would alter a data structure. You can modify a data structure, but it returns a new data structure, yet the old one remains if it is not GC'able. All of the common data structures have…
How is the cost of copying close to zero or not apparent?
Re: Pixie – A small, fast, native Lisp
#155Earlier quoted context omitted.
Well, in most cases `[]` is used just like you'd use a quoted list `'()`. Clojure vectors are nice for the performance they give. Having maps with `{}` syntax is also nice if you ask me. Makes reading a little bit faster.
> Clojure vectors are nice for the performance they give. What difference does it make when representing code?
I was thinking about it over the day, and realized maybe having special syntax actually is confusing - maybe "normal" lisp with only parens is better. Thanks for the eye-opener.
Re: Pixie – A small, fast, native Lisp
#156Earlier quoted context omitted.
I have used Chicken Scheme on Raspberry Pi to good effect. Clojure is likely slow because the JVM runtime requires much more disk access than compiled-to-C systems.
Have you tried any Clojure->Scheme compilers? After that stage you can use any Scheme->C/Whatever compiler.
Re: Pixie – A small, fast, native Lisp
#157Re: Pixie – A small, fast, native Lisp
#158Earlier quoted context omitted.
pmap in CL is one library away, along with preduce, ... ( https://lparallel.org/ ).
Is it lazy?
Besides, the semi-lazy approach of Clojure's pmap (allocate futures consecutively) doesn't seem to convince everyone:
https://stackoverflow.com/questions/2103599/better-alternati...
https://www.reddit.com/r/Clojure/comments/20lxmv/just_what_i...
On the one hand, when you want to parallelize, you are delegating tasks to workers and you want them to do what they need, independently of you. But on the other hand, laziness introduce a dependency from you, because workers cannot produce a result before they are sure you really need it. This basically slows down parallelization and that's why I am not sure Clojure's pmap is a good general solution.
Note that Clojure Reducers, mentioned here in Zombie Metaphysics (ppmap: http://www.braveclojure.com/zombie-metaphysics) and documented at https://clojure.org/reference/reducers, use strict sequences.
Laziness is great when you need it, but when you don't you shouldn't have to pay for it.
http://clojure.com/blog/2012/05/08/reducers-a-library-and-mo...
Re: Pixie – A small, fast, native Lisp
#159Earlier quoted context omitted.
Come to think of it, some docker and other fancy container magic could also help adoption. And other such things people use nowadays. Maybe a nodejs integration? Stuff like that.
My dream would be to just use something like Picolisp on Windows without the workarounds. Maybe that can be done via the new Bash on Windows10? Idk.
They say WSL apps can not interact directly with Windows apps. So yes and no to your question. I would say it would be similar to running in a virtual machine but more integrated.
Re: Pixie – A small, fast, native Lisp
#160Earlier quoted context omitted.
> Clojure vectors are nice for the performance they give. What difference does it make when representing code?
What I meant was that [] when glancing just means the same as '(). I was thinking about it over the day, and realized maybe having special syntax actually is confusing - maybe "normal" lisp with only parens is better. Thanks for the eye-opener.
The idea behind the Lisp reader approach is that custom syntax is used for reading/printing objects of different types, not to demarcate syntactic elements. For example, double quotes are for strings, #P"" will read pathnames, and so on. In Common Lisp, some characters like [ and { are reserved for the user, meaning that no conforming implementation defines a custom syntax based on those characters. And you can define [a b c] to mean (vector a b c), which will build a vector, when executed, to hold the current values of a, b and c. The existing #(a b c) vector syntax is a literal vector that contains symbols.
From this point of view, for Clojure, I don't think it is a bad idea to have a short syntax for vectors, set and map literals. But then, those objects are used when representing code, not because it has a real added value but because the visible syntax is a little bit nicer (maybe, maybe not). That IMO complexifies tools that work with code and does not really fulfill a practical purpose. If that was for practical reasons, I think bindings would had been better defined as maps: as far as I know, they seem to fit more naturally than vectors for this task. For example:
(let {a 20 b 10} ...)
Somehow when compiling or interpreting the code, you could do "(get symbol env)" where "env" is the surrounding lexical environment associated with the let, which would be computed partly from a parent lexical environment and {a 20 b 10}. The environment and the map could be of the same type and be easy to combine.
But there is no such consideration, and it is actually a good thing that there is no link between how the code is represented and how it is interpreted (also, there can be different interpretations).Basically, I find Clojure a little bit confused about its use of external data representation for code. I would have preferred a simpler syntax for code and keeping those notations for data, where they are self-describing without additional context.