This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-07-24
Channels
- # babashka (19)
- # beginners (43)
- # calva (10)
- # clj-kondo (3)
- # cljsrn (8)
- # clojure (106)
- # clojure-europe (8)
- # clojure-hungary (5)
- # clojure-nl (1)
- # clojure-uk (1)
- # clojurescript (14)
- # core-typed (1)
- # graalvm (2)
- # graphql (1)
- # malli (2)
- # membrane (9)
- # observability (2)
- # off-topic (66)
- # polylith (3)
- # practicalli (3)
- # re-frame (17)
- # reagent (3)
- # remote-jobs (7)
- # rewrite-clj (17)
- # sci (29)
- # shadow-cljs (45)
- # sql (5)
- # tools-deps (15)
- # vim (8)
I'm considering to buy a Macbook Air M1 for traveling. I wonder if compiling GraalVM programs on such a machine would be comparably fast as on a Macbook Pro 2019 i9, roughly due to the M1, but perhaps Rosetta and the lack of active cooling make it worse... any experiences?
I have a company issued MBP M1. It's really light, thin and fast! I throw a lot at it and it never really gets warm.
I could stick it out with my current Macbook Air 2015 but compiling babashka already isn't really an option with that one :)
I don't notice a difference between an application (in terms of speed/performance), once Rosetta 2 has got it translated.
I also run with the Azul JVM which (last I looked) is the only JVM available that runs natively on Arm64 for the Mac.
I do believe version 17 of the JVM (Open/Adopt) will have Arm support for Mac natively.
@dharrigan it would be really useful to me if you could try to compile babashka on your M1 and see how long it takes, take a screenshot of the last 20 lines of output
I was just about to say the same :)
Well, perhaps @dharrigan can post them in a gist :)
for comparison, my newish Thinkpad P14S Gen 1 (Ryzen 7 pro 4750U, 32 gigs ram) took:
[bb:17543] (typeflow): 23,700.72 ms, 4.90 GB
[bb:17543] (objects): 66,759.19 ms, 4.90 GB
[bb:17543] (features): 2,009.31 ms, 4.90 GB
[bb:17543] analysis: 98,277.51 ms, 4.90 GB
[bb:17543] universe: 4,615.15 ms, 5.71 GB
[bb:17543] (parse): 2,051.17 ms, 5.27 GB
[bb:17543] (inline): 5,563.54 ms, 4.72 GB
[bb:17543] (compile): 28,879.32 ms, 5.04 GB
[bb:17543] compile: 39,062.50 ms, 5.05 GB
[bb:17543] image: 7,787.64 ms, 4.89 GB
[bb:17543] write: 837.38 ms, 4.89 GB
[bb:17543] [total]: 155,682.14 ms, 4.89 GB
(assuming those were the timings you were comparing)
The thing to bear in mind here, is I assume since no graalvm is out yet with native arm64 support, then rosetta2 is having to translate on the fly.
It's defintely being translated on the fly. I was watching Activity Monitor and it reports Intel
as the Kind
. If it was native it would say Apple
.
A totally subjective heat test (by me placing my hand under the laptop during the compilation), made me think maybe 2 or so degrees warmer to compile. However, unlike Intel MBP's - my laptop is totally silent and doesn't sound like I'm standing beside a 747 about to take off.
Personally, I think it's so amazing that it works to compile to a native image on aarch64, without me having to jump through hoops.
(not that the bb
is native, i.e., aarch64, it's still an intel
image - just that it's possible to do this!)
When I got my M1 Macbook I found performance varied enormously on the choice of java you were using. I settled on openjdk 1.8.0 zulu compiled for Mac aarch64.
Has anyone looked at https://github.com/PlummersSoftwareLLC/Primes with a view to creating a Clojure entry?
This is a prime numbers language comparison drag race for a bit of fun. Many languages are represented notably, Scala, Haskell, Lisp, FSharp, Elixir, Java and many more.
It might be a fun exercise indeed, but nothing beyond I'm afraid. I think it is worth to know it is no good to take part in every possible race. One must choose a race to take part in, and pass others. Clojure is not a language designed for computations, so signing up for a performance race, it is signing up knowing that you will get beaten 😬
Apologies, for the delayed response. I wasn't thinking that Clojure would out perform the whole field. I did think it would be fun to see where Clojure would fall out in among the other functional and or jvm based languages. Even if that is last. If you're wondering why not DIY it, my answer would be that to stand chance of providing a representative primes program then the developer would need to be someone with real world experience and strong subject matter knowledge.
I had a fun time thinking about primes and had to get up one night at 2 am with an algorithm in my head recently. https://replit.com/@sova2/PrimeSoup#main.clj It's pretty simple, it keeps a list of primes (a set) and for each new number it tries to divide it by the numbers in the set, and if it returns true it omits the number, if it returns all falses it adds it to the list, goes to the next number. It's certainly not as fast as the bit-sieve produced at the link above, but I find that it is quite readable 😃
I like it.
What are some of your favorite coding challenges you've had in interviews?
Mine was to write a calculator app, that used RPN for its backend interpreter. That was admittedly many years ago.
That does sound like a fun challenge. Did it not take a while to do?
It did, but the language that the company used at the time was VB .Net 2 (Some dating information) and there was a good bit of time given to the task.
If you accept take home projects for an answer, mine was a concurrent task manager. One manager, multiple workers, tasks of different kinds (can be added during run-time), one worker switching between task of different kinds incurs a penalty - the goal is to plan all tasks in such a way so there's as little overhead as possible. Incidentally, it was also my first Clojure project. They told me to use any language I wanted, so I decided to go with the most potentially interesting one. I even have sources somewhere, although I haven't looked at them since - no idea how good the actual code is.
hi, if you have the full text at hand I would be interested . thanks
That's a very intriguing challenge. So jobs were defined as a task with a time to run and stuff? Cool arrangement problem.
Without a predefined time, IIRC - each task just had some particular kind and length. Also, it was the only time I used STM. :D
Software Transactional Memory: https://clojure.org/reference/refs
So far in my (nearly 40 year) career, only one company required a coding challenge in the interview and I walked out at that point. A couple of companies have wanted a design sketched out on a whiteboard but not actual code. My opinions on "coding challenges" are pretty well known here I think 🙂
(def total-number-of-coding-challenges-participated
{:in-interview 2
:upcoming-in-interview 1
:take-home 2
:upcoming-take-home 1})
nonzero. maybe i'll go back to putting code samples on my resumeTBH some of the companies had unrealistic demands. I used to apply back in 2015 to one of the companies utilising Cocos2d-x engine, an engine for making crossplatform mobile games. They knew I don't know the engine. The task was to build a simple game. "Here you have some resources, build something with it. It shouldn't take you more than 4h". I laugh now, but I spend about a week learning the framework and building a game (btw supporting 3 desktop platforms and 2 mobile). At the end they hired me, but seriously, this is not something that should be a norm. I mean, as long as it is fun to do a coding challenge I don't mind spending some time on it, but generally I think this is not something that should be a norm. If it takes a few hours, you should be paid for it.
Some of the coding challenges that are not too bad, are these taking up to 20 minutes during the f2f interview. You sit with the hiring company dev, or maybe even pair program with him/her, and you take and solve together some abstract problem, or debug & solve some bug. It doesn't take much time, and it is more social, and even if they don't hire you, you have the opportunity to learn something from that dev. Win win.
I had a day of ups and downs today, literally. First this happened on a hike: I sunk past my knees in a bog, it wasn't deep at all but then one step and all of a sudden I sunk 😞 Cue hours of wet feet and being miserable and my camera covered in mud. At least there was a stream I was able to clean off in, but no towel... Lesson learnt, in the future take change of socks and a towel and some wet wipes. But then it was worth it to see this: https://flic.kr/s/aHsmWgATue The views were spectacular, seeing the peaks rise of out of the clouds.