Pros and Cons of Apple silicon for Elixir dev?

For those of you who have Apple silicon Macs, how are you finding them? Have you noticed any pros or cons for Elixir dev or dev in general?

4 Likes

The only con is the difference in architecture from prod, requiring you to set up a CI of some sort.

Other than that, I don鈥檛 see nor am aware of any regressions.

6 Likes

Haven鈥檛 had too many issues some random libraries and support packages have issues but most the time there is a work around or an alternative package you can use. But these are mostly system level stuff not elixir or erlang themselves. Also usually using Rosetta does the trick but sucks juice out of the battery like crazy. So far haven鈥檛 had enough issues to warrant not buying one or trying to find intel macs.

1 Like

The main one should be that you cannot just toss 鈥攑latform linux/amd64 at Docker since QEMU does not support Erlang versions after OTP25. That means you don鈥檛 get to easily build multiarch images locally.
That鈥檚 really the only thing, though. Wonderful machines otherwise.

4 Likes

It can work, you just need to set this flag: Update Elixir and Erlang versions (#1939) 路 livebook-dev/livebook@6256b66 路 GitHub :slight_smile:

16 Likes

I am very new in the Apple silicon based development (just a couple of weeks). So far, I do love the extra autonomy due to low battery usage and the ability to have large unified memory to run memory-hungry servers (e.g. Elasticsearch).
An Elixir specific issue that, so far, I do not even know if it is possible to address, is how to utilise the GPU in ML training. While this was relatively easy with PyTorch, I think that Nx ecosystem does not support that, yet.
CPU tasks run a bit faster than the previous Intel based MBP (anecdotal impression close to 30%), but it is not game-changing.
As the others said, I might have to invest my time into employing containers, which is also a positive thing in the sense that I will learn something new (so far I only develop locally).
I did not need Rosetta, yet.

4 Likes

Thanks everyone - it鈥檚 good to know the transition to Apple Silicon seems to have gone relatively smoothly. I wasn鈥檛 intending on getting a new Mac until M4, but it looks like Apple are dropping support for Intel Macs quicker than many expected:

Still going to hold out for as long as I can tho鈥

3 Likes

After using thinkpads/windows later linux for almost 20 years I switched to Mac Pro earlier this year.

I will never go back. No issues.

5 Likes

Nice one Sebastian! Curious why you opted for the Mac Pro? Do you have a specific need for it?

1 Like

I bought the first generation Macbook Air M1 when it was new.

Cons:

  • if you need to use an old version of Erlang (before 22.3.something) it just won鈥檛 work. The earliest version I鈥檝e been able to install using asdf is 22.3.4.26, for use with elixir 1.8.2-otp-22.
  • you cannot run linux in M1 macs yet (but Mac OS isn鈥檛 too bad)
  • I鈥檝e yet to find a way to use my 鈥渘ormal鈥 (non Mac) keyboards flawlessly
  • not sure if related to this chip or the old versions I need to use, but compilation of Elixir project is slow.

Pros:

  • lightweight, silent, and great autonomy (all reasons which made me buy it)

Overall 11/10, and I am no Apple fanboy (never owned an Apple product before that one)

2 Likes

A post was split to a new topic: Off-topic post from Apple Silicon thread

It could be Spotlight indexing. Check out this Erlang and Elixir on Apple Silicon/M1 Chip - #61 by wojtekmach, and especially the very next post!

2 Likes

sorry MacBook Pro.

4 Likes

I bought an M1 MacBook Air when they announced the Studio when I was thinking the M2 Airs were coming. I have no regrets other than that maybe I would like the form factor of the M2 better? M1 is a crazy nice machine and for how I work, I鈥檓 not sure I would even notice a difference with anything more performant. I鈥檝e had zero issues with lag and I鈥檝e only seen the Spinning Wheel of Death twice since I got it a little over a year ago (and I spend a gross amount of time on this thing).

One sort of funny 鈥渃on鈥 I ran into to illustrate this: I never bothered installing any kind of visual CPU monitoring in my taskbar on this thing and recently I noticed my battery was draining reallllly quickly. It would last less than an hour! I didn鈥檛 think about it too much at first since I鈥檓 mostly always on power and there were no indications anything was struggling (even when not connected to power). I finally realized that I had recently started up an old Rails app that my current work uses and I鈥檇 never shut it down. There were 3 Ruby processes running at >100% each with no audible indication and no hints at all that anything else might be starved for resources鈥攍ike, not even a little! I鈥檝e never had that experience before, even on other multicore machines.

Er, sorry that wasn鈥檛 very Elixir specific. Other than having to set a flag or two, I鈥檝e had zero issues.

4 Likes

If you by old versions mean that you are using Erlang/OTP 24 or earlier, that will indeed make a noticeable difference because you are not using the JIT.

3 Likes

Thanks for the tip, it seems faster indeed!

@bjorng yeah, still using OTP 22. Should be able to upgrade in a few months

2 Likes
  • you cannot run linux in M1 macs yet (but Mac OS isn鈥檛 too bad)

Asahi Linux is coming along. https://asahilinux.org/

1 Like

You already have one. Go into /Applications/Utilities/. The Activity Monitor application. You can put it in the dock, right click on it and by default show whatever activity or activity-history you like. The app鈥檚 window shows all the detail, too. I keep it in the dock because it鈥檚 a nod to old x-windows stuff. :slight_smile:

2 Likes

Oh that鈥檚 cool, I never saw those options! Unfortunately, this won鈥檛 work for me as I effectively don鈥檛 have a dock as it鈥檚 always hidden with a long delay for it to show.

1 Like

Apart from very long battery life - at least half a day of solid work, not just browser or email - and being lightning fast? :wink:

4 Likes