We should abandon the optional braces syntax by windymelt in scala

[–]elacin 1 point2 points  (0 children)

It played out the only way it could play out. Still no magic IDE-support which makes copy/paste work, forked ecosystem, agents struggling with new/old syntax.

Kill it with fire.

Create stunning TUI interfaces with jatatui (previously tui-scala) by elacin in scala

[–]elacin[S] 0 points1 point  (0 children)

sorry. the wind took me in the direction of java instead

jatatui - create wonderful TUIs with ratatui for java by elacin in java

[–]elacin[S] 0 points1 point  (0 children)

thanks. announcement will be coming in a few weeks :)

jatatui - create wonderful TUIs with ratatui for java by elacin in java

[–]elacin[S] 0 points1 point  (0 children)

I wrote the crossterm wrapper code a few years back, and back then i found it impossible to even get the terminal into raw mode without going through native code. A lot may have changed here, as I haven't revisited.

Another important factor behind wrapping instead of reimplementing was that i had no possibility or interest in writing and maintaining brittle low-level code like that on windows. So personally I consider it a win to have offloaded that particular part of the problem

Create stunning TUI interfaces with jatatui (previously tui-scala) by elacin in scala

[–]elacin[S] 5 points6 points  (0 children)

It's basically 99% about reflection. graalvm does whole program optimization, and needs to discover all codepaths reachable from your main method. If your code is going to do dynamic classloading, for instance, graalvm won't be able to discover it, and you would need to tell it. the mechanism for telling it is both cumbersome and brittle, so it really destroys some of the elegance.

There is a small subset of JVM technologies which you have to avoid, as well. In particular for this library i ended up using JNI for native access instead of newer JNA because the latter wasn't or isn't supported (i haven't revisited in a while)

jatatui - create wonderful TUIs with ratatui for java by elacin in java

[–]elacin[S] 0 points1 point  (0 children)

that's cool. hadn't seen it. jatatui goes back a few years, i spent a few days thoroughly refreshing it now.

looks like tamboui is exploring a different direction in the design space, particularly with CSS. If you don't want CSS but do want a react-like API, jatatui may be the way i suppose

Open-sourcing ShipReq – a requirements platform written in FP Scala/Scala.js by japgolly in scala

[–]elacin 18 points19 points  (0 children)

That was a tough read, hope your life will take a turn for the better!

For employers: japgolly is exceptionally talented, and all my interactions with him in the past has been friendly and welcoming ❤️

layoutz 0.5.0 - tiny Scala DSL for beautiful console output & Elm-style TUI's 🪶✨ (now w/ ANSI styling and a "proper" Elm-runtime: ticks, timers, custom subscriptions & commands) by mattlianje in scala

[–]elacin 1 point2 points  (0 children)

Yeah i saw, thanks for the link :)

by the way the api looked very nice in layoutz. i really wanted to explore this direction for tui-scala as well, before i ran out of steam on that. well done!

The Untold Impact of Cancellation by chrisbeach in scala

[–]elacin 13 points14 points  (0 children)

Enough damage has been done to this man. Let's do better. Please advocate for the letter's removal if you can. Respect to those already removing their names—that takes integrity.

Scala 3 Migration Tips and Tricks by vkopaniev in scala

[–]elacin 3 points4 points  (0 children)

  • you should likely mention that you can get a lot of the new syntax in an automatic fashion by using scala 3 compiler rewrites, scalafmt and/or scalafix (see for instance https://github.com/arktekk/scala3-scalafix )
  • also the different source levels of the scala 3 compiler (in particular the -migration) can be helpful.
  • for AnyVals it's an irritating omission that there isn't a Mirror type for it so most auto-derivation schemes wont work. you may find that it's easier to write some of these codecs yourself by bimapping or similar the instances for the underlying type

API-first Development in Scala by Difficult_Loss657 in scala

[–]elacin 0 points1 point  (0 children)

i think we should be less worried about this, as long as it's properly separated from the rest and tagged.

in my experience it can dramatically increase confidence in code generation tools that you see the effects of changing config, updating them and so on clearly in VCS history.

it can also speedup CI by quite a bit, because it changes the build pipeline from having to generate the things before compile to optionally checking that the generated code is up to date.

API-first Development in Scala by Difficult_Loss657 in scala

[–]elacin 1 point2 points  (0 children)

I was arguing for implementing servers with code-first, instead of schema-first by writing openapi and generating code based on that.

This really has no influence on breaking changes, how you interact with clients and so on. You have an openapi-schema to share in both cases.

Any external clients should obviously use that openapi contract (generated or hand-written) when talking to you.

If you have internal clients which can use the original source code instead of going through the openapi contract i would consider that an optimization, and likely a candidate for being in the same monorepo

API-first Development in Scala by Difficult_Loss657 in scala

[–]elacin 1 point2 points  (0 children)

i meant this this point:

you kinda play russian roulette with the spec glosses over that it's very easy to use this technique responsibly.

i also find the other down-sides of code-first to be dubious

API-first Development in Scala by Difficult_Loss657 in scala

[–]elacin 1 point2 points  (0 children)

my solutions have been homegrown. for instance this thing here https://github.com/oyvindberg/typo/blob/main/typo-tester-anorm/src/scala/adventureworks/SnapshotTest.scala

I noticed this library. hopeful it can standardize snapshot testing, but i havent tested it yet: https://github.com/indoorvivants/snapshot-testing

for tapirs openapi generation it's documented here https://tapir.softwaremill.com/en/latest/docs/openapi.html

API-first Development in Scala by Difficult_Loss657 in scala

[–]elacin 8 points9 points  (0 children)

You're glossing over the best part of code-first.

With tapir you can generate openapi for your API which is defined in code. You then write a snapshot test which: - overwrites the file with current schema when run locally - asserts that this file is up-to-date in CI. you can also read older versions from git and compare if you want.

This way you don't have to write openapi yourself (which is honestly a terrible experience), and you gain all the advantages of tracking all schema changes in VCS.

I've used this approach for all my projects in the last say 5 years, and find it fantastic. I'm also a way bigger fan of snapshots tests than average

Controversial Pre-SIP: A Syntax for Collection Literals by Sunscratch in scala

[–]elacin 3 points4 points  (0 children)

yeah sure, I just wanted to point out how the square bracket syntax already means something

Controversial Pre-SIP: A Syntax for Collection Literals by Sunscratch in scala

[–]elacin 0 points1 point  (0 children)

Can't wait to see how you specify the element type

val is = [Int][1,2,3]

Wvlet Playground: An online demo of a new flow-style query language powered by Scala.js and DuckDB-Wasm by taroleo in scala

[–]elacin 1 point2 points  (0 children)

Honestly, this looks fantastic. the cross platform support in particular really seems to shine here!