Fork me on GitHub
#off-topic
<
2020-07-07
>
SoV413:07:24

https://www.youtube.com/watch?v=WyjWUdkwPaQ Amazing sound/song by Burna Boy ... feels like summer in my heart

respatialized16:07:21

https://openjdk.java.net/jeps/378 I didn't realize Java was about to add this feature. Are there plans to add recognition of these new string/text block literals to the Clojure compiler/interpreter?

noisesmith16:07:15

clojure doesn't use the java compiler anywhere, so I don't see how it would be relevant

noisesmith16:07:07

I guess the java compiler is used to compile clojure itself, but clojure doesn't really need string literals like that?

noisesmith16:07:09

there's no clojure interpreter, the compiler turns all input into jvm bytecode before running it

noisesmith16:07:37

I guess it would be clearer to say that eval turns input into bytecode before running it

noisesmith16:07:01

(`compile` also exists, for when you want to write bytecode to disk instead of running it)

souenzzo16:07:03

For me this is a text block 👀 (valid since 1.0/2008)

(def html "
<html>
  <body>
    <p>Hello, world</p>
  </body>
</html>
")

noisesmith16:07:33

the difference is you need to escape \ I guess

alexmiller16:07:26

supporting multi-line text blocks has been requested, considered, and rejected multiple times in Clojure's history and we are not going to add it

orestis16:07:09

I think the decision and possibly the rationale merits a faq entry :)

alexmiller17:07:14

the rationale is mostly a) we've done fine without it and b) would break all Clojure parsers in existence

💯 1
hiredman16:07:28

String as a datatype is also bad, you are better off using clojure collection literals containing strings and writing your io functions to take collections of strings instead of using big string literals

👍 1
hiredman16:07:08

(string is immutable without structural sharing, copy on write)

noisesmith17:07:42

my two least favorite API decisions are concretizing File for input / output and String for the result of accessing input / source data to output

alexmiller17:07:04

clojure.string fns all depend only on CharSequence by design

alexmiller17:07:24

but I'm sure there are many less careful places

alexmiller17:07:24

but I'm sure there are many less careful places

noisesmith17:07:26

cargo cult unixism?

orestis17:07:50

I like Erlangs IOLists

1
orestis17:07:35

It was so nice that they can be nested but also “invalid” in the general list sense for the sake of efficient IO and avoiding expensive copy operations.

noisesmith17:07:25

I keep intending to play with erlang

orestis17:07:12

It’s fun. Elixir gives it a Clojurey spin too.

noisesmith17:07:00

my current "new language" project is assembler (learning ARM assembler and reading TAOCP), but erlang is definitely on the list

orestis17:07:02

What, no VM? Crazy 😜

noisesmith17:07:12

what I'm seeing is that a lot of what I'm learning (especially via TAOCP) applies to the jvm (via the ASM.java lib that clojure uses to compile classes), luajit, wasm - there are a lot of things that provide APIs that try to look like a CPU architecture, and its useful for debugging, security, or getting highest performance possible from tight spots in code

noisesmith17:07:28

I'm thinking about making some lisp helpers to generate assembly code, and I'm realizing that path leads to making a bootstrapping compiler after a few steps

orestis18:07:46

Heh, I’ve done assembly etc back in uni days. The most recent thing was an Advent of Code puzzle that had you implement a CPU of sorts to run a small program, and the next step was to actually write a debugger to optimize a program that would otherwise take years to finish :)

orestis18:07:17

Great fun, but too far removed from information systems for humans which is what interests me work wise :)