Fork me on GitHub
#off-topic
<
2020-12-05
>
eggsyntax15:12:26

Just mentioned by Julie Sussman at the re:Clojure conference:

😺 6
borkdude16:12:27

Still waiting for the Clojure edition ;)

😀 9
borkdude16:12:42

But meanwhile I have the printed Scheme version here. Should really just read it.

eggsyntax16:12:33

Having it in JS feels exciting to me for exposing the ideas in SICP to a much wider audience.

borkdude16:12:47

Yeah, I agree!

borkdude16:12:58

And this could eventually lead people to CLJS too

seancorfield18:12:09

@eggsyntax Have you read Grokking Simplicity by Eric Normand? A lot of FP presented in JS.

eggsyntax18:12:04

Haven't yet, but planning to at some point. Not a fan of JS, to be honest, but I've read a fair amount of Eric's blog and it'll be neat to see a culmination of those ideas. Perspective from two hours later on SICP/JS -- looking back, I feel like part of the magic of SICP was starting with something so simple that you could grasp it in its entirety, and building the rest from there. I'm curious about how well that'll translate to JS with all its idiosyncrasies -- maybe they start with a tiny subset of JS and build from there? Maybe build it into what JS might have been if it'd been built today in a more considered way rather than being added to piecemeal over decades from a rushed start?

seancorfield18:12:08

I'm definitely no fan of JS either but Eric's book is good (although the JS hurts my eyes at times 🙂 ).

😆 3
cdpjenkins19:12:33

When I went through (some of) SICP many years ago, I used Python, since that seemed the most appropriate language that I knew at the time and Clojure didn't yet exist. I definitely didn't get the magic feeling of building everything from the ground up but it was still very interesting. I feel like doing it in Clojure would be similar.

cdpjenkins19:12:01

(And JS, though I have no desire to do that :-)

dharrigan19:12:40

I would really really welcome a Clojure version of SICP

borkdude19:12:32

@dharrigan there is this project: http://www.sicpdistilled.com/ but I think it stalled

dharrigan19:12:03

5 years stalled :s

dharrigan19:12:13

but thank you for the link, will read what is there...

phronmophobic19:12:14

if it's impure, I would prefer get-classpath!

borkdude19:12:04

how impure would you consider reading from an atom to be on a scale of 1-10?

borkdude19:12:31

The other function is called add-classpath (without exclamation mark, same as Clojure used to have)

phronmophobic20:12:06

well, on a scale from 1-2, it's a 2.

borkdude20:12:09

user=> (doc add-classpath)
-------------------------
clojure.core/add-classpath
([url])
  DEPRECATED

  Adds the url (String or URL object) to the classpath per
  URLClassLoader.addURL

borkdude20:12:48

for counter-examples

phronmophobic20:12:11

I think the ! is more important for a function like get-data than add-data as add-data is more likely to imply that the operation is impure. Does the classpath only grow? or can it shrink?

borkdude20:12:20

The function deref itself also hasn't an exclamation mark btw :)

borkdude20:12:51

right now we only have add-classpath so right now it can only grow

phronmophobic20:12:17

the point of deref is to conduct a side effect. I think the ! helps especially when it might not be obvious that a function is impure. If you think get-classpath successfully conveys that, then it's probably fine.

borkdude20:12:48

the question wasn't: get-classpath or get-classpath! but rather classpath or get-classpath

borkdude20:12:39

but I can we can extend the poll to three options

borkdude20:12:35

spec uses registry for getting the registry from an atom, but get-spec for getting a spec by some key

borkdude20:12:00

so maybe get- also implies some lookup thing and some container thing

phronmophobic20:12:13

personally, I feel like you gain more by saying "watch out! this is impure" and having a ! than any downside of having a ! , but I'm probably in the minority and it's probably fine either way.

phronmophobic20:12:47

if that's the convention established by core clojure code, there's definitely a benefit to matching convention

dpsutton20:12:07

If it is subject to change call it “current-classpath”?

👍 6
souenzzo21:12:42

I use "current" in these cases too.