Fork me on GitHub
#off-topic
<
2019-01-29
>
Chase00:01:29

so i'm just curious when I see different benchmarks where would you place clojure in terms of java performance? Is it pretty close? They never seem to have clojure listed but java always makes an appearance. This Arcadia project (clojure to Unity (C#?)) has me so intrigued and I wonder if clojure really does have the performance capabilities for some decent game dev when I get to that level.

hiredman00:01:52

it is complicated, single tight loop performance, clojure is the same or close to java, but the performance is less stable, you can easily kind of fall off that hill and perform worse.

hiredman00:01:13

run of the mill code, I would be surprised at any performance difference between java and clojure

Chase00:01:40

nice. Because it seems java more than holds its own to some other very fast languages. I'm trying not to worry too much about performance at this level but I was just reading that games require something like evaluating the whole game state in 16ms or something to hit 60 fps. not sure if java/clojure can do that.

Chase00:01:52

but would java even matter if it's on this CLR thing?

hiredman00:01:46

no, you would be comparing it to C#, and the clr clojure port

hiredman00:01:11

the clr has things like value types (instead of refernce types, not sure how clojureclr handles that), which can matter for the performance for certain kinds of problems(which games could easily be), but from what I understand the jit and the gc aren't as sophisticated as the jvms

Chase00:01:31

ok cool. I now find it interesting how clojure integrates with a host language. It's kind of neat. Like if a new language of the future just takes off could we just bring clojure right on over and build off that too? it actually makes it a durable language huh?

Daniel Hines00:01:38

I'm watching the MIT SICP lectures, and they're mind blowing so far https://m.youtube.com/playlist?list=PLB63C06FAF154F047

😄 5
Chase00:01:11

i so want to do SICP with Clojure but even Rich Hickey has said it probably won't help learn Clojure. But I already fight myself to stop trying out new languages and just learn clojure. Scheme seems pretty similar and simple though so maybe it wouldn't hold me back and set a better programming foundation for me.

Daniel Hines00:01:24

So far it's very primitive (in a good way!). No noticable differences in the syntax (besides an extra paren when defining functions and "define" instead of "def")

john00:01:44

I really wouldn't mind programming in any language as long as it has a clojure-y dialect, if only for the efficient syntax. I'd rather do the other language using just clojure interop, with the ability to macro over it.

💯 5
john00:01:22

granted, the semantics in some languages are more different than others

Daniel Hines00:01:06

One of the surprising things is that the professor is programming by "wishful thinking" - translating mathematical functions directly into lisp code with functions that don't exist yet, then filling in the defns as he goes. It's a sort of top-down approach, and its pretty magical to watch. I almost always do the opposite - start small and try to build up. What do you guys normally do, and under which circumstances (I imagine strategies very with context)?

erwinrooijakkers09:01:58

I love that GJS quote: “Wishful thinking is essential to good engineering, and certainly essential to good computer science.“ 🙂

gdanov21:02:43

that's practice not limited to lisps. I've done it in java and javascirpt as well

Daniel Hines21:02:10

Yeah, this course is helping me appreciate JavaScript a lot more; even if it's quite as elegant, it has many of the essential pieces to be extremely powerful.

Daniel Hines21:02:28

Namely lambda's!

lilactown00:01:06

lately I’ve been working on some more experimental libraries and APIs, and I’m doing a lot of that wishful-thinking style 🙂

lilactown00:01:19

I write an example using the dream API I want, think about it, start to fill it in, change my mind and re-work the dream-example, then keep filling in the API as I think about the solution

lilactown00:01:24

I’ve been using declare a lot too to avoid errors about something not existing, so I can test parts of the example that I’m implementing at the time

5
Chase00:01:46

not to derail but what exactly do you mean when you say API? Like you are creating a library that will do some main task and you can bring it into your other projects?

lilactown00:01:31

yeah I clarified that a tiny bit in my above message. I mean like libraries, yes

Chase00:01:31

i'm kind of curious how people develop without a great repl. I think that's what lets me experiment so much, whether top down or bottom up.

lilactown00:01:32

people are surprisingly resourceful 😄

lilactown00:01:48

I think it’s why many people advocate for TDD: it gives you feedback

lilactown00:01:29

and honestly it’s not a bad idea at all when you’re doing the kind of “wishful thinking,” top-down strategy of development

lilactown00:01:02

but it’s awful when you’re first exploring the domain

Chase00:01:26

i think i was just browsing an article you recently wrote. it seems you use ocaml too right? Do you have to do a big mind shift when going from a statically typed to a dynamic language? Does that affect whether you are doing this top down vs bottom up?

lilactown00:01:18

I’ve dabbled in OCaml off and on for the past few years but mostly do Clojure for fun and profit. I am watching that community very closely though because there’s a lot of good ideas coming out of it

dpsutton00:01:33

re without a repl, unit tests become how you interact with code. especially if your unit you are making requires several dependencies to be injected to work

dpsutton00:01:04

i'm looking at ocaml and F# right now. not sure why someone would choose one over the other right now

lilactown00:01:10

mainly the biggest switch is the toolchain / workflow. but I get pretty good feedback from the OCaml compiler, and then I run my program which tells me if I’m right 🙂

lilactown00:01:45

@dpsutton I haven’t tried F#, since .NET Core was so new the last time I really wanted to use something other than Clojure. I like the fact that OCaml can compile to a native binary, for start

dpsutton00:01:21

yeah. i guess i'm just a little put off by the lack of asynchronous story. it's always right around the corner

lilactown00:01:10

honestly, I’ve had very few instances where threads were actually necessary for my application. I’m always stoked to use a language that has them and then promptly don’t 😛

lilactown00:01:37

I’m coming from having done mainly front-end and web back-ends for the past 4 years so YMMV

lilactown00:01:45

AFAICT Lwt offers a nice abstraction over async I/O kind of like Node.js

dpsutton00:01:09

What is let?

lilactown00:01:16

@chase-lambert to answer your question a bit more, I would say that OCaml behooves me to approach it from a more top-down than bottom up, since I like solving puzzles and the type system trickery is a nice problem to solve

jaihindhreddy-duplicate10:01:59

I have a system that includes a couple of services and a bunch of processes on crontab that interact with the database. Is there some way to isolate the whole thing and control time to test stuff like "when I make this request to this service, this row must exist here after 30 minutes" without waiting 30 minutes?

vemv13:01:17

make the "30 minutes" configurable, and pass a value of 1ms in your test