Fork me on GitHub
#off-topic
<
2019-05-01
>
steveh201814:05:02

I was looking up info on instaparse and ran across this guy's website (also has an active YouTube channel). Whoa! Lots of great condensed info / tutorials besides his clojure writings. http://xahlee.info

solf15:05:35

He's pretty famous on in the emacs community

solf15:05:37

also has the most comprehensive ergonomic keyboards comparison

šŸ‘ 4
dkrieger16:05:29

yeah I definitely read a bunch of his tutorials when switching from vim to spacemacs

todo16:05:50

Anyone knows what's going on with all the recent Tesla news? Seems to be bimodal: one side: Tesla is going to fail. Short short short short short short. other side: Tesla is the greatest innovation since iPhone.

code star 817:05:51

I am not trolling. But I have a very serious question about the future of the JVM. I am starting to doubt if its needed anymore. If so many things are going server side where we can control the machines. Am I wrong?

code star 817:05:59

If the JVM was awesome for set top boxesā€¦ pos, tv etcā€¦ why do we need it now? Iot seems to be going native, Cuda is native, web servers are nativeā€¦ etcā€¦ And android is leaving the JVM for flutterā€¦ Someone convince me I am wrong?

code star 817:05:45

I donā€™t want to invest years into any languages that could dissapear overnight if Oracle yanks any more plugs

code star 817:05:45

sorryā€¦ I know it is kinda of negative to ask thisā€¦ but Iā€™d prefer to face facts nowā€¦ and not realize I made a mistake, 3 years laterā€¦ like I did with Rails

code star 817:05:44

is there any plans to make Clojure compile to native code?

hiredman17:05:29

the jvm has a deep and wide set of libraries, has many man years of work in the vm itself, is entrenched in many businesses, and there are non-oracle builds available

code star 817:05:18

I agree. I like the library supportā€¦ but many people are telling me the memory usage is costing them server costs

hiredman17:05:21

regardless of the ideas of how it would be used when it was started, it has been largely used for server work loads for decades now

code star 817:05:10

I really love Clojure and Kotlin

code star 817:05:41

but I think they need to go native to survive

code star 817:05:27

Itā€™s kind of frustrating right nowā€¦ I love Clojure over Haskell

code star 817:05:05

because companies arenā€™t going to pay the high license costs to Oracleā€¦ they will have to use the open jdk

hiredman17:05:18

https://www.techempower.com/benchmarks/ is the largest set of benchmarks for webservers I am aware of, and jvm based stuff always does very well

code star 817:05:34

yesā€¦ itā€™s very good. I saw that.

code star 817:05:40

top of the charts

code star 817:05:56

personally, I am ok with the memory usage

code star 817:05:33

but I think the memory usage could be a problem as devices become smaller

code star 817:05:42

and energy efficient is needed

hiredman17:05:45

those are mostly using openjdk

hiredman17:05:51

(the techempower benchmarks)

hiredman17:05:10

you started off talking about servers and now want to talk about small devices

code star 817:05:39

well, itā€™s the same ideaā€¦ server energy costs or IoT device costs

code star 817:05:04

feel free to correct me

code star 817:05:09

I could be totally wrong

hiredman17:05:12

IoT is a buzzword that covers basically anything

hiredman17:05:13

from what is just a small computer (a pi or a beaglebone) to something that is actually a different environment like a microcontroller

dkrieger17:05:02

ClojureScript can also target node.js, so even if JVM ecosystem became toxic over night (won't happen), Clojure would still have a host language with a huge ecosystem

hiredman17:05:03

but in general those kinds of devices have a long history of using virtual machines to achieve higher code density then they normally can

hiredman17:05:27

arm chips even at one time had extensions to execute jvm bytecode natively

code star 817:05:51

wowā€¦ 2 good points

code star 817:05:31

hmm. ya, I am just as afraid about relying on the V8

hiredman17:05:13

the jvm runs great on a pi or the beaglebone, I've actually built a little rover on a a rc car body that had a beaglebone running clojure as a brain

code star 817:05:37

I need to try a jvm install on my rasp

code star 817:05:23

there is 1 thing I love about virtualizing things

code star 817:05:49

I love VMWare for that reasonā€¦can just reset itā€¦ if something breaks

code star 817:05:03

snapshot it, break it, rollback

hiredman17:05:20

the jvm is a very different thing from a hypervisor

gklijs17:05:22

Why do you think that? The jvm performs great compared to native is my experience, just the startup is slower, but many things run for a long time.

code star 817:05:49

I think it just uses more memoryā€¦ garbage collectors

code star 817:05:05

I am watching video

gklijs17:05:31

Yes, it starts at 200Mb..

code star 817:05:35

did you try the make block kit?

hiredman17:05:46

I don't know that anything there will be relevant to this conversation, it is just an existence proof of the rover

code star 817:05:06

well, if you used jvm on a raspā€¦ that is proof

code star 817:05:27

the smallest device Iā€™d use is a nano

hiredman17:05:38

it is a beaglebone, which is similar to a pi (but has some nice additional features like the prus)

code star 817:05:56

ya, thatā€™s super cool

code star 817:05:03

I bet that opens doors for you

hiredman17:05:38

it was a hobby that I kind of moved on from, too much like my actual work (but very cool)

code star 817:05:03

ya, I have a bunch of electronics sensors, kitsā€¦but little time

code star 817:05:20

I setup the maker block robot kitā€¦ with a pi

code star 817:05:37

ok, I feel betterā€¦ about JVMā€¦

code star 817:05:59

I think I am going to keep pushing forward on Clojure and Kotlinā€¦ I love both languages

dkrieger17:05:12

if the JVM situation got really dire, I'd count on someone like Google or AWS to fork the runtime (or create a new runtime that is compatible w/ Java libs). There's simply too much invested into that ecosystem to let it die

dkrieger17:05:51

(and a small army of lawyers would make a mint in the process)

code star 817:05:16

yaā€¦ when I first started looking into the functional worldā€¦ I tried Haskell, first

code star 817:05:29

but then when I saw Clojureā€¦ I fell in love.

code star 817:05:25

I am going to try typed Clojure thoughā€¦ I am not totally sold on the false paradigm of static versus dynamicā€¦ I think both have their place in the world

eggsyntax15:05:08

FWIW, I think that spec offers everything static typing does and more (with the exception of being runtime rather than compile-time, but that makes less difference than you'd think). In typing terms, spec is similar to advanced dependent types like Idris has. And just to reply to the original question while I'm here -- the future of languages is hard to predict, but I feel very confident that the JVM will still be in common use a decade from now. Past that, I could easily see it being replaced by jvm-bytecode-to-native toolchains like GraalVM aspires toward, or for that matter other things that we haven't heard of yet. But for the short and medium-term, the JVM isn't going anywhere šŸ™‚

code star 817:05:52

thatā€™s a whole other blog post though. hahahaha

hiredman17:05:23

amazon has there own jvm distribution if I recall

code star 817:05:15

and they canā€™t get sued because itā€™s openjdk?

code star 817:05:06

wow, Solaris too. I love their file system.

gklijs17:05:36

I build the same microservice (using Kafka and PostgreSQL) on Rust, Kotlin (with spring), and Clojure, memory of Rust was much lower, but cpu was higher..

code star 817:05:38

ZSH has amazing snapshot capability

code star 817:05:24

@gklijs are you liking the Rust ownership model for concurrency?

gklijs17:05:05

It can be hard sometimes, but that also makes it more rewarding when you do get it to compile.

code star 817:05:32

Also. I need to decide on using Kafka or Spark for my first real data toolā€¦. I will be reacting to 1000's of messages per minute

gklijs17:05:35

1000's a minute is not so much.

code star 817:05:49

ya, just a start

code star 817:05:03

I think most CPUā€™s max at about 20k messages per second

code star 817:05:13

on the network IO

code star 817:05:40

Java does fine with that scaleā€¦ or JVM

code star 817:05:24

is Kafka good for that? real time?

gklijs18:05:38

Yes, can be in milliseconds. You do have to make a trade off between throughput and latency. You even risk messages getting lost for a bit less latency, it's all configurable, but that can be overwhelming as well.

code star 818:05:16

hmmm. this is for an api client, reactive, real time

code star 818:05:37

I think latency would be more important. I can lose a few messages

gklijs18:05:45

I have a demo setup with a GraphQL endpoint, end-to-end latency is about 100 ms, but could even be a bit less.

code star 818:05:04

if you want, I can take a look. I donā€™t care if you use it for work. Sounds like a fun project.

code star 818:05:10

I like to load test

code star 818:05:41

I was going to put up a Kafka or Spark setup repo on githubā€¦ test it for performance

gklijs18:05:57

I think I will put the whole setup, including kotling, rust and clojure variants on there. I also have a load test program, and a way to display the statistics from the load test. Just need to improve the docs a bit, and add some cli/bash-script to make it easy to run it.

code star 818:05:31

I can help write the docs too. I write well.

code star 818:05:44

and I write bash/sh

code star 818:05:00

are you using JMeter tool or something else to load test?

gklijs18:05:06

Thanks, but there's a buch of stuff only in my head now. Just clojure, I set the load with an Nrepl, and meeasure cpu/memory also from clojure. Put the data in one .edn file, and can compare several runs with vega

code star 818:05:03

is there anything I could do to start it? focus on Clojure with Kafka?

gklijs18:05:42

Kafka Streams API is really nice, but much easier to use with Kotlin then Clojure, especially with combined with Spring.

gklijs18:05:09

Really depends what you want to do, the Kafka ecosystem is huge

code star 818:05:30

Spring Boot? or just Spring?

code star 818:05:38

I was looking at Vert.x

code star 818:05:47

I am 100% sold on Kotlin

gklijs18:05:52

Spring Boot with Spring Cloud

gklijs18:05:39

Vert.X can be nice, but in my current project they made a mess with it, and was not used for being reactive..

code star 818:05:45

okā€¦ how about I setup a simple Kafka projectā€¦ Kotlin or maybe Clojureā€¦ and you check it out

code star 818:05:16

let me know how it can help you at workā€¦ whether load testing, proof of concepts etcā€¦

gklijs18:05:12

You could review/add when it's almost done, if I put it first as a private repo. Will take a few weeks, and still not 100% sure about putting it public.

code star 818:05:32

that would begreat

code star 818:05:53

trying to polish up my github with newer techā€¦I usually wait to make it public after I polished the docs

code star 818:05:08

I hate git repos with bad docsā€¦ I had to make a few repos last night, private

code star 818:05:14

ohh. are you using VueJS? or just backend?

gklijs18:05:34

It's a bit mixed with mine, I got a Rust library that's well documented and well tested, but the rest is more or less dying.. Also like part of the clojure stuff could be library. As far as I know there isn't really a recent clojure kafka library. Since the api is stable I think it would be nice to just Have some wrappers around the Kafka api as a library, making the dependency to Kafka provided so it can be used with newer versions of Kafka easily.

code star 818:05:35

I do need to look into Rust/C for WebAssembly, also

gklijs18:05:43

Current backend is a vary ugly Angular/AngulerJs hybrid, with only gets/posts to the server..

code star 818:05:03

hmmm. I left off at Angular v1

code star 818:05:36

I like Vue because it has the command line

gklijs18:05:33

There so many things these days šŸ™‚. Also want to take a look at nats https://nats.io/ sounds very much like kafka but easier to run in the cloud (but kafka is also going to improve on that)

code star 818:05:35

maybe you could use a Vue proof of concept?

gklijs18:05:12

I'm leaving there soon, and really like re-frame myself. I hardly hear anything about Vue here (Netherlands) It's mostly Angular and a bit of React

code star 818:05:52

React is very good too. Vue just has better dependency setupā€¦ little more modular

drone17:05:25

going back to typing. if you want a FP language with mixed dynamic and static typing, Racket is probably the current best choice. Typed Clojure has languished (though hopefully not dead)

code star 817:05:29

wellā€¦ Clojure is so goodā€¦ I can forgo typing for what I doā€¦ I am not building airplanes or avionics systems that can crash from 1 bug

john17:05:02

I wouldn't say it's languished. Ambrose just hasn't made a ton of waves about it recently. I think he's in the midst of delivering his thesis on the subject.

john17:05:42

* defending

drone17:05:24

eh, the type checker crashes and takes out the running process and current defaults/assumptions for type annotations are painfully inconvenient

drone18:05:14

yeah, he defended last week. hopefully he isnā€™t burnt out and/or can now be more open to others contributing

code star 818:05:38

itā€™s considered anti Clojure culture? static types?

john18:05:56

I'd imagine he's quite relieved šŸ™‚

drone18:05:05

@codestar8 static types are generally viewed as not being worth the trouble by Cognitect and that belief does influence some Clojure users

code star 818:05:51

probably because we focus on data, data science, number crunching etcā€¦?

code star 818:05:57

not building mars rovers

drone18:05:11

Clojure is being used to write all kinds of programs. I do think Cognitect tends to work on projects (web backends, data processing pipelines) that donā€™t really need types or where types can be painful to manage

drone18:05:56

but if youā€™re trying to use Clojure for, say, anything related to compilers and program analysis, then types are kind of useful

code star 818:05:04

I listened to a StrangeLoop talk. And these 2 people blasted Clojure. Said crappy Rails devsā€¦ are now crappy Clojure devs. Kinda of hurt my feelings. But I do understand their reasoning for types.

drone18:05:13

yeah, thereā€™s no need a belief about type systems needs to result in personal attacks

code star 818:05:03

ya, nothing personal. but they had a lot of wisdomā€¦knew a ton about type systems. but when they suggested ocamlā€¦ I was thinkingā€¦ hmmm. it has a global lock on the interpreter

drone18:05:20

though I certainly understand the frustration of someone who enjoys Clojure but wishes the core team was committed to gradual typing šŸ˜‰

code star 818:05:53

I think optional or gradual typing would spread Clojure to the Scala and Haskell types

code star 818:05:31

if anything, we might even have the most robust type system because of macros/meta programming?

john18:05:34

People say Rich and Cognitect are "against types" but I'm not so sure I've seen evidence of that. They seem to just want some features to be option. Like CPS/core.async. If someone came up with a great static verification tool for Clojure, I'd imagine lot's of people would use it, including Cognitect

john18:05:38

Or even an Erlang actor model ported over to CLJ. If someone made a stellar implementation, I'm sure lots of folks would use it. And probably Cognitect too, even if they don't want such a thing in core.

john18:05:01

But, I technically have no idea - I'm not associated with Cognitect in any way

code star 818:05:14

thereā€™s no actor model for Clojure, yet?

code star 818:05:25

horizontal scale out of the box?

drone18:05:30

I mean, Rich and Stu both say some pretty snarky things about types

drone18:05:46

and not just once, but all the time

john18:05:57

There's an actor thing IIRC, but I think it did some bytecode manipulation on top of Clojure's

drone18:05:02

just scan Stuā€™s twitter posts

code star 818:05:47

I think Rich has a background in real time data systemsā€¦ machine learning type stuffā€¦ probably shaped his view of the world

john18:05:54

Well, there's a war out there about whether type systems should be religiously bolted on to languages, such that they won't work without them... It think that's a different argument

code star 818:05:02

opposed to building an airplane system

code star 818:05:18

Type Script did things right

code star 818:05:49

but to be fair, static types didnā€™t save that 1 nasa projectā€¦ what was it? Orion?

code star 818:05:05

crashed billions of dollarsā€¦ because of 1 bad metric/imperial conversion calculation

code star 818:05:34

joke comingā€¦ we all should just use ADAā€¦ works for missilesā€¦ should work well for web. :rolling_on_the_floor_laughing:

drone18:05:46

having ā€œtypesā€ isnā€™t a panacea. but modern type systems (e.g., Haskellā€™s or Rustā€™s) trivially support something as simple as a missed conversion

code star 818:05:36

or Clojure Spec, test data driven dev?

drone18:05:46

I think spec is a missed opportunity to embrace gradual types. in certain cases, spec could be used to annotate structural types and be statically checked. for other cases where arbitrary predicates canā€™t be avoided for describing the data, or on typed/untyped borders, specs can then be used for optional runtime checks. and of course they could still be used to generate tests

Daniel Hines18:05:02

Thereā€™s a project thatā€™s doing this: https://github.com/arohner/spectrum

šŸ’„ 8
drone19:05:25

yeah, I need to check this again. but it wasnā€™t working last time we tried

code star 818:05:42

remind me againā€¦ predicates? newb alert,here

drone18:05:34

type systems allow you to express various constraints on a value (e.g., variable x represents some unsigned int)

drone18:05:50

but letā€™s say your type system didnā€™t support specifying that something is unsigned. you could instead use a predicate (fn that takes a value and returns true/false) such as: (fn [x] (and (int? x) (<= 0 x))

drone18:05:04

but now you have a function that must be run to determine whether something is correct. so now your ā€œtypeā€ depends on runtime information because it must evaluate the x

code star 818:05:27

I watched a Microsoft research videoā€¦where they monitored devs in the labā€¦ they did conclude that types sped up dev timeā€¦ said devs do less reading of what the function does

code star 818:05:04

if they know what types of arguments it takesā€¦ less need to analyze the guts of the function

jaide18:05:30

https://medium.com/javascript-scene/the-shocking-secret-about-static-types-514d39bf30a3 > Type correctness does not guarantee program correctness. Which is I think where Cognitect seems to focus on. Itā€™s not that they officially dislike types, it appears that they want to incorporate the benefits while addressing the shortcomings rather than repeating what other languages already have.

drone19:05:45

the conclusion seems too simple. maybe itā€™s also the case that more bugs are found (and fixed) in statically-typed languages and thus the ā€œliveā€ bug density for a statically-typed program is smaller

drone19:05:56

tricky to test for that

code star 818:05:00

I think TypeScript took off becauseā€¦ larger teams have trouble managing big JS code basesā€¦ for exampleā€¦ 6 different ways to define a function in JS

code star 818:05:24

one time, I spent half the day looking for 1 JS method because they used 1 of the uncommon method declarations

jaide18:05:42

I imagine itā€™s kind of like transportation technology from way long ago. At one point the answer to ā€œWhatā€™s the fastest way from point A to B?ā€ was ā€œHorses. Duh!ā€ Then someone had to come up with the idea of a car. ā€œWhatā€™s the fastest way to make JS more stable?ā€ ā€œStatic types. Duh!ā€ So they looked back and remembered the virtues of static types. It may be the best way to achieve that, but I think itā€™s important for people to take a look at those concepts and try to find alternative solutions, even if itā€™s a derivative of what came before.

dkrieger18:05:11

so the newest/favorite languages in my stable (horse pun šŸ˜‰ ) are golang and clojure, which I would consider complete spiritual opposites

dkrieger18:05:53

golang's "type everything" approach combined with its "really rigid and simplistic syntax, abstractions are evil" approach go very well together

dkrieger18:05:43

that combined with its standardized toolchain makes it really easy for blub devs to jump into a golang project and get out without too much beard stroking

dkrieger18:05:10

clojure leans into the dynamic functional tradition of "define/test absolutely as many abstractions as possible so that the main loop is very terse and lean, and so long as you know what the abstractions do, and can trust them (due to tests/specs), your main loop should just be your relatively easy to understand business logic, with all of the implementation details tucked away"

dkrieger18:05:18

(just a clojure noob's perspective)

dkrieger18:05:29

in this model, all that's left to do once you've imported your toolset of abstractions, is write integration tests for your business logic. static types don't necessarily help with integration tests all that much

Daniel Hines19:05:18

Does the notion of beauty/elegance have pragmatic value in software? I choose Lisp because thereā€™s a purity I find beautiful, but businesses choose lisp because people produce better software cheaper/faster. Do these reasons share some identity, or, at least, some common ancestry?

manutter5119:05:01

I suspect thereā€™s common ground between pragmatism and beauty in that simplicity lends to both.

Daniel Hines19:05:21

Sure. By that logic, beauty would correlate with pragmatics, but not be an end in itself.

Daniel Hines19:05:22

And of course, the notion of ā€œbeautyā€ depends on a particular aesthetic, which could be highly debatable/individual.

donaldball19:05:18

Iā€™d aver that elegance correlates strongly with being easy to learn, understand, and maintain.

Daniel Hines19:05:53

Maybe because itā€™s easier to see how different parts fit together, and even suggest/require eachother?

donaldball19:05:50

Yes, e.g. when there are powerful, simple abstractions at work, e.g. unix pipes, clojure seqs, datomic entities

donaldball19:05:10

Software that is intended to be long-lived or serve a wide audience benefits from such elegance; a one-off ETL job might not.

Daniel Hines19:05:11

My wife (a professional musician) and I were speculating yesterday that music is beautiful not when itā€™s simply fitting or simply surprising, but rather when itā€™s ā€œsurprisingly fittingā€.

jaide23:05:10

That insight resonates a lot with me. I like some of the more extreme music genres such as dark ambient and the work in that genre I enjoy usually have some sense of structure to them. Even if it shifts and twists in unexpected ways. The works I donā€™t enjoy focus on repetition or donā€™t seem to show any semblance of structure to them.

john19:05:24

aye, some blend of symmetry and asymmetry. Usually with more symmetry and little novel asymmetry.

Daniel Hines19:05:23

Often in good art the chosen symmetries and asymmetries are the non-obvious ones.

john19:05:30

looking at you, s-exprs

Daniel Hines19:05:52

Yeah, s-exprs have that ā€œsurprisingly fitā€ quality.

Daniel Hines19:05:59

So little can build up so much.

john19:05:22

Makes for a canvas that can look almost invisible

Daniel Hines19:05:11

Iā€™d be interested to know what Hickeyā€™s tastes in art are. I conjecture two cases: extreme realism (i.e, the incidental medium should get out of the way of the picture), or extreme minimalism (the picture should get out of the way of the idea).

Daniel Hines19:05:32

(A third case is that Iā€™m reading too much into it :P)

donaldball19:05:39

He talked some about microtonal music on a cognicast episode

donaldball19:05:17

Probably not very illuminating but perhaps thought-provoking

john19:05:12

I think @borkdude did his dissertation on a musical system in lisp. There seems to be a lot of musical lispers out there

borkdude19:05:31

it was my masterā€™s thesis, but yeah šŸ™‚

john19:05:40

ah right

dkrieger19:05:54

douglas hofstadter, who wrote the "metamagical themas" column for a time in scientific american (as well as Godel, Escher, Bach), wrote about lisp and music, not necessarily in the same context though, but the various themes he wrote about tended to intertwine. lisp definitely has a sort of compositional/intuitive nature that is reminiscent of music

borkdude19:05:21

FP in general lends itself well to the musical domain