@alexelcu@social.alexn.org
@alexelcu@social.alexn.org avatar

alexelcu

@alexelcu@social.alexn.org

This profile is from a federated server and may be incomplete. Browse more on the original instance.

alexelcu, to Blog
@alexelcu@social.alexn.org avatar

“Scala's Future”

Gather around, kids, let me tell you two stories from my past in the software industry.

https://alexn.org/blog/2024/01/10/scala-future/

#Blog #Scala #Scala3

alexelcu, to programming
@alexelcu@social.alexn.org avatar

"Update NextDNS with a Scala CLI script"

Today I was reminded how awesome Scala is for scripting, via Scala CLI. And it goes beyond having “batteries included”.

https://alexn.org/blog/2024/01/10/update-nextdns-with-a-scala-cli-script/

#Scala #CLI #Snippet #Shell

alexelcu, to firefox
@alexelcu@social.alexn.org avatar

#Firefox for #Android opened access to more extensions. I use uBlock Origin and Dark Reader.

Other reasons to use Firefox on Android — history sync that actually works, “open in app”, multiple search engines, not adversarial, feels good using it.

https://blog.mozilla.org/en/mozilla/new-extensions-youll-love-now-available-on-firefox-for-android/

alexelcu, to programming
@alexelcu@social.alexn.org avatar

A hidden gem in #Scala's #sbt build tool is the testQuick command. If you're not using it yet, you should.

https://www.scala-sbt.org/1.x/docs/Testing.html#testQuick
#op

alexelcu, to programming
@alexelcu@social.alexn.org avatar

https://adventofcode.com is starting soon.

This year, challenge yourself to solve those puzzles in #Scala 3, significant indentation and all 😍

So who's up for it? And would you like to see me struggle?
#adventOfCode #op

gabrielesvelto, to climate
@gabrielesvelto@fosstodon.org avatar

"Richest 1% emit as much planet-heating pollution as two-thirds of humanity"

I don't think there's anything else to add to #Oxfam's last campaign report. #ClimateChange #ClimateInequality

https://www.oxfam.org/en/press-releases/richest-1-emit-much-planet-heating-pollution-two-thirds-humanity

alexelcu,
@alexelcu@social.alexn.org avatar

@gabrielesvelto the article is disingenuous in its framing, because it actually talks about the "investments" of the richest 1% into things that the entire population demands, such as energy or cement.

alexelcu, to programming
@alexelcu@social.alexn.org avatar

In principle, I know the advantages of dynamic type systems — treating code as data, or inventing types on the fly, based on runtime conditions. In practice, I've never seen any good use of dynamic type systems, only downsides.

Everything good about dynamic type systems has to do with tooling. The culture of simplicity, the REPL, the scripting, creating types based on external input (DBs, JSON files), etc. These are all great, yet nothing that a static language can't do better.

#programming

alexelcu, to Cats
@alexelcu@social.alexn.org avatar
alexelcu, to programming
@alexelcu@social.alexn.org avatar

It doesn't matter if people disagree on 4-spaces indentation for #Scala 3 because:

‣ Most of you haven't worked with “optional braces”, yet;

‣ When you'll do, and frustration builds up, my SEO-optimized website will be there to whisper in your ear 👨‍👦

alexelcu, to programming
@alexelcu@social.alexn.org avatar

A great tell that #Scala 3's significant indentation will cause a lot of pain is that blog articles now have indentation bugs.

I'm reading a blog article. Great writing, authoritative source. But my eyes spot at least 4 indentation errors, across multiple snippets, probably caused by multiple edits. It's also inconsistent in its use of “fewer braces”, as some anonymous functions use braces, and some don't.

Indentation was supposed to be human-friendly. At least 2-space indent is not.

alexelcu, to chrome
@alexelcu@social.alexn.org avatar

Great article introducing , shipping in 119 and 120.

It explains the performance and interop benefits. And how targetting WasmGC is like targetting a new VM, with existing LLVM-based implementations not currently compatible.

Languages that have working WasmGC implementations: , , , (wasm_of_ocaml) 😍

https://v8.dev/blog/wasm-gc-porting

chris__martin, to random
@chris__martin@functional.cafe avatar

It's not ideal but I do accept the reality that there's a chance I will personally be hurt by the blowback from actions of my
government. Part of everybody's responsibility is to moderate not just their self but to help moderate the groups they belong to, however incidental the belonging.

alexelcu,
@alexelcu@social.alexn.org avatar

@chris__martin The state doesn't represent the “will of the people”.

And dictators can't be overturned, actually, unless the state's institutions are failing. In a well-oiled police state, changing the leadership is impossible. If you're thinking about USSR & the Warsaw Pact countries (in which I was born), the Iron Curtain only failed due to institutional collapse.

You may think that people can rise. Nothing that a bunch of tanks can't solve.

@brandewinder

alexelcu, to mastodon
@alexelcu@social.alexn.org avatar

On #Mastodon I'm getting plenty of pleasant interactions, and it's a nice place, but it's very one-sided.

I wish to see more #Scala, #Kotlin, #Java or general programming content. Being on my self-hosted instance certainly doesn't help with discoverability, although I am using https://relay.fedi.buzz/ to follow these tags.

alexelcu, to random
@alexelcu@social.alexn.org avatar

One thing I don't get in IDEs is the warning that I'm shadowing another variable name.

Bro, name shadowing is healthy, as it can prevent errors. You should be giving me a warning when I should be shadowing a name, but I'm not.

#op

alexelcu, to programming
@alexelcu@social.alexn.org avatar

Let's say we want a Set[Throwable], to detect duplicate exceptions, so we need to come up with a reasonable comparison function that works for Throwable. Plain equality doesn't work, as Throwable is mutable (has identity).

The linked #Scala sample is surprisingly difficult to translate into other JVM languages (e.g., #Kotlin, #Java), due to:

‣ Tuples;
‣ Persistent list (stack) with useful operators;
‣ Deep pattern matching;
‣ Tail-recursion;
‣ Expression-oriented.

https://gist.github.com/alexandru/3282ed5e92aa121083fc4c38526d5a66

alexelcu, to chrome
@alexelcu@social.alexn.org avatar

#WasmGC is now enabled in stable #Chrome by default.

https://developer.chrome.com/blog/wasmgc/

It's also enabled by default in #Firefox (120.0b4). #Safari seems to be the only one out of the picture, as usual, but for many apps (intranet, kiosks) it's safe to assume mainstream browser support.

https://webassembly.org/roadmap/

#Kotlin has an implementation that integrates with WasmGC:

https://kotlinlang.org/docs/wasm-overview.html

Other implementations are LLVM-based (e.g., #dotNET Blazor, #Scala), and may take more time.

chris__martin, to random
@chris__martin@functional.cafe avatar

Do metric people really pretend y'all don't measure stuff with your feet too

alexelcu,
@alexelcu@social.alexn.org avatar

@chris__martin, sure, but we make big steps to approximate a meter

alexelcu, to programming
@alexelcu@social.alexn.org avatar

This is why I'm excited about #Scala 3.

Source: https://mpilquist.github.io/talk-fpis/

olafurpg, to random

Got my new Windows work laptop today. Will be sharing anecdotes in this thread.

First anecdote: WSL is a game changer. It’s ~9x faster to clean compile my main work project (Cargo workspace) on WSL compared to on Windows. Takes 22s on WSL, 33s on my M1 Max, and ~3 minutes on Windows. Single threaded WSL is also faster than M1 Max.

alexelcu,
@alexelcu@social.alexn.org avatar

@olafurpg You should try Windows Terminal, I remember it having a saner UI:

https://apps.microsoft.com/detail/9N0DX20HK701

What you're saying about WSL is surprising. WSL v1 had horrible I/O performance, and WSL2 is a virtualized environment. It can't be faster than native Windows programs, unless those programs have serious issues.

It makes Windows bearable, but integration with Windows isn't the best. E.g., to access files in WSL from IDEs, you need those IDEs to be WSL-aware.

alexelcu,
@alexelcu@social.alexn.org avatar

@hugovr Haven't used Windows in a while, thanks for the info 👍

I'd go for WSL for anything dev, too. It's basically a Linux distro (e.g., Ubuntu). Not all apps worked, but never had issues with CLI-powered ones.

@olafurpg

alexelcu, to random
@alexelcu@social.alexn.org avatar

#Debugging is a learned skill, as people go into investigating issues w/ too many assumptions.

Pro-Tip: double-check everything (e.g., don't just assume that the app is loading a config from the right path).

#op

chris__martin, to random
@chris__martin@functional.cafe avatar

a billion dollars is enough to give everybody in the world 12 cents

alexelcu,
@alexelcu@social.alexn.org avatar

@jabberati Equal distribution means a centralized economy and a complete absence of freedom, what happened in USSR and elsewhere. This map is a simplistic charicature missing the fact that, with equal distribution, there wouldn't be much wealth to distribute. I'm not sure if you realize it, but the allure of authoritarianism is ever present, always dressed with good intentions.

Cheers 👋

@chris__martin

alexelcu, to random
@alexelcu@social.alexn.org avatar
alexelcu, to chrome
@alexelcu@social.alexn.org avatar

TIL Chrome 119 (beta) ships with Wasm GC enabled by default, no flags needed:
https://groups.google.com/a/chromium.org/g/blink-dev/c/K_GpDF0y5Q8/m/XIJSfbTHBwAJ

For Kotlin, checkout these samples:
https://github.com/Kotlin/kotlin-wasm-examples/

#Chrome #Wasm #WasmGC #Kotlin #op

alexelcu, to programming
@alexelcu@social.alexn.org avatar

TIL that #Scala Native now has continuations (merged 2 weeks ago). Gosh, that's so cool:

https://github.com/scala-native/scala-native/pull/3286

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • ngwrru68w68
  • everett
  • InstantRegret
  • magazineikmin
  • thenastyranch
  • rosin
  • Durango
  • khanakhh
  • Youngstown
  • slotface
  • ethstaker
  • kavyap
  • DreamBathrooms
  • provamag3
  • osvaldo12
  • normalnudes
  • modclub
  • GTA5RPClips
  • tacticalgear
  • mdbf
  • tester
  • cisconetworking
  • anitta
  • Leos
  • cubers
  • megavids
  • lostlight
  • All magazines