HNHacker News
TopNewBestAskShowJobs

sideeffffect

307 karma · joined January 5, 2019

submissionscomments
sideeffffect··on Metals with Scala 3
> the compiler has no way of suggesting to you

Of course it does. And since Scala 3, it does suggest to you the imports you need for implicits. And IntelliJ does recommend imports even for Scala 2.

Regarding cats, the codebase has been restructured, so that you won't need the implicit imports (or not as much at least): https://meta.plasm.us/posts/2019/09/30/implicit-scope-and-ca... The trick there is that the Type class instances were moved to appropriate companion objects which are searched by the compiler by default and thus the used doesn't need to do any manual imports.

sideeffffect··on Writing high performance F# code
AFAIK Credit Suisse have their quant library written in F#.
sideeffffect··on F# is gaining independence from .NET
> Isn't F# pretty much OCaml.NET?

Kinda yes, kinda no. There's a whole interesting story to it:

https://dl.acm.org/doi/pdf/10.1145/3386325

sideeffffect··on F# is gaining independence from .NET
Oh yes it does count. Scala can be a nice functional language, with a powerful module system.

Although I miss type providers, enforced lack of cycles and other nice things, like syntax:

https://contributors.scala-lang.org/t/scala-3-very-impressiv...

sideeffffect··on Java on Truffle – Going Fully Metacircular
> GPL doesn't permit commercial use

That is alarmingly false. Do you have a source that McNealy indeed has said that? I couldn't find anything by googling.

sideeffffect··on .NET NanoFramework
AFAIUI _monomorphisation_ and reification are interchangable.

That means, that if I have a polymorphic (generic) class `MyClassA<T>`, the compiler (regardless if it is JIT in the runtime as in C#, or AOT as in Rust) monomorphises (reifies) `MyClassA` for each instantiation of `T`. So `MyClassA<MyClassB>` and `MyClassA<MyClassC>` are distinct classes.

For this reason, co-/contra-variance in C# works only for interfaces. Type parameters in classes are invariant. `MyClassA<MyClassB>` and `MyClassA<MyClassC>` are distinct classes, neither sub-/super-class of the other, even if `MyClassB` were a subclass of `MyClassC`.

sideeffffect··on .NET NanoFramework
It it possible to use this with F#?
sideeffffect··on .NET NanoFramework
"Generics" in Haskell are real, but they're not what is in the .NET lingo called reified. Just like Java does not monomorphise.

On the other hand, C#, F# or Rust monomorphise (have reified generics).

sideeffffect··on Why Zig when there is already C++, D, and Rust?
Has anyone tried to combine Zig with Cosmopolitan libc yet?

https://justine.lol/cosmopolitan/index.html

sideeffffect··on Milestone: Half a million downloads for VideoLAN packages in the .NET ecosystem
> that is what killed F# effectively

F# has been an unwanted child of Microsoft, it actually adopted the language from Microsoft Research. As a language, F# is _very_ good (although not as good as the original OCaml, whose features had to be cut to be able to run on CLR). It's just not first-class citizen, so not everything may work with F#. And F#'s own development and features are blocked on CLR -- instead of F# charting its own path, each feature first has to be available for C#/CLR and only then will F# developers implement it (higher-kinded types are just one example).

But it's still much more pleasant "syntactic sugar to write the CIL bytecode" than C# can ever be.

> even Scala is dead

I beg to differ! Thankfully, Scala is very much not dead. Scala 3 is around the corner, with many more features and, even more importantly, several simplifications. And the community is also much larger compared to F# (or any other ML language, like Haskell). Innovation also takes place in the realm of libraries, like ZIO for example.

sideeffffect··on An Invisible Tax on the Web: Video Codecs (2018)
> Algorithms are not simply math, in the same way mechanical engineering is not simply math.

Algorithms are _literally_ mathematical objects. C.f. Church-Turing thesis.

> And if it were simply math, then there would be no way to work around those patents, which plenty of open source codecs have done in various directions.

Show me an H.264 codec that works around the patents in the MPEG LA pool. Also software patents are orthogonal to the question of "open source" (which is about copyright). That there is very often no way to work around the patents in an otherwise independent implementation is precisely the problem with Software patents.

> Unfortunately, most open source codecs are not as good at compression, mostly since the patented ones have a massively bigger pool of engineering behind them from dozens of companies banding together their work to develop best of breed solutions.

Show me the numbers. Because the numbers I know (for example the chart in the blogpost itself) show that x265 is the best codec (or encoder, if it's not a decoder too) for H.265, it self being "open source", better than proprietary alternatives.

> And eventually the patents expire, and the world gets these codecs free to use.

Even after patents expire, copyright expires in 90 years.

sideeffffect··on Haskell is a Bad Programming Language (2020)
> Scala has its own drawbacks wrt. Haskell: lack of typed effects is a big one for me.

There are libraries like ZIO, Cats Effect or Monix. Give them a try! Some people might even say that for example ZIO is even better than Haskell's IO.

sideeffffect··on Haskell is a Bad Programming Language (2020)
But F# doesn't have async/await. As you write, it has "computation expressions", which are inspired by Haskell's "do-notation", but are more generalised and powerful (than both Haskell's "do-notation" or Scala's "for-comprehension", let alone async/await).

One of the things I liked best about F#.

sideeffffect··on Orthodox C++
I'm not a C++ developer, but AFAIK the fact that C++ is not 100% "you don't pay for what you don't use" is commonly acknowledged. Exceptions are an example of that.

There are ideas/proposals how to fix that: https://www.youtube.com/watch?v=ARYP83yNAWk

sideeffffect··on Where Did Combinators Come From? Hunting the Story of Moses Schönfinkel
Really amazing cast: Dana Scott, Phil Wadler, Barry Jay, last student of Curry (whose name I don't remember)... it's really interesting to see all these people together.
sideeffffect··on Std::visit is everything wrong with modern C++ (2017)
Why not F#? :)
sideeffffect··on Project Loom and Structured Concurrency
I've posted above how Scala's IO/Task is different from C#/Kotlin async-await.

https://news.ycombinator.com/item?id=25305574

I hope you will find it helpful.

sideeffffect··on Project Loom and Structured Concurrency
> Scala/Haskell's IO type

Since you've brought out Haskell's IO and Scala libraries' IOs (Monix, ZIO, Cats Effect), or F#'s Async, I think it's worthwhile to point out how they're different from the async-await approach that's in C#/Kotlin/Rust/etc.

They both require "special" handling -- in C# it's the `async`/`await` syntax, in Scala it's the flatMap function or for-comprehension -- there they are similar. But their meaning is different. IO/Task in Scala doesn't represent a possibly started and under-way computation; it represents a "dead" program, yet to be started, a mere value. And it has all the advantages that mere values have, like refactoring (extract variable, ...) or restarting in case or failure and so on. Pass it into a method, return it from a method, store it in a data structure/collection, create `IO[IO[X]]`, whatever you want, just like you would with `Option[X]` or `List[X]`. In Scala, you have to differentiate between `A => B` and `A => IO[B]`, because `B` and `IO[B]` are different, but both are still values. Your program then ends up being this one big IO/Task value, which is then executed "at the end of the world". These pictures illustrate it quite well:

https://twitter.com/impurepics/status/1182946618280153094

https://twitter.com/impurepics/status/1180064851219144704

On the other hand, async-await has none of the benefits, only downsides. You get functions of two colors, but no benefit in return. It's justifiable in Rust, because Rust aims for zero-cost abstractions. But for Kotlin/C#, it's a sad choice.

The Loom approach for Java is a reasonable one. No async-await shenanigans, no funny FP/Haskell/IO business. You just use threads for concurrency as God intended them and you can have gazillions of them, because they are M:N. And I respect that, even though I'm partial to IO/Task for the reasons outlined above.

sideeffffect··on Git is too hard
There is an answer to the perceived bad UX of Git: Gitless.

https://gitless.com/

Is has already been mentioned a couple of time in this thread, but it deserves a more prominent mention, because IMHO it's a really interesting project.

The author(s) analysed git UX shortcomings and tried to learn from them. For example, Gitless aims to align well its concepts with user's intentions. There have been written research papers (and a talk is available online) about their methodology and Gitless design:

https://spderosso.github.io/oopsla16.pdf

https://www.youtube.com/watch?v=31XZYMjg93o

sideeffffect··on We need less powerful languages (2015)
Interestingly, just recently, Neil Mitchell has published an article claiming that this is a fallacy and in practice, people are forced to back-pedal on it.

    Ban recursion and unbounded loops. Proclaim the language is "Turing incomplete" and that all programs terminate.
    Declare that Turing incomplete programs are simpler. Have non-technical people conflate terminate quickly with terminate eventually.
    Realise lacking recursion makes things incredibly clunky to express, turning simple problems into brain teasers.
    Add recursion.
    Realise that the everything is better.
https://neilmitchell.blogspot.com/2020/11/turing-incomplete-...
sideeffffect··on Copyright vs. Copyleft (2007)
The Free software movement hasn't gone anywhere. Copyleft licenses still exist, so does the Free Software Foundation.

There are now more people who care about these things and more quality Free software available than ever before in human history! It's just that the complacent open-source idea, as well as proprietary software (biggest offenders are locked smartphones, etc), have spread even faster :(

I don't think the movement has weak foundations nor that it is politically naive. In my eyes it goes directly to the problem it cares about, which is human freedom in the context of using a computer. It doesn't oppose commerce, but it is aware of the current socio-political order's (i.e. capitalism's) tendency to turn anything into a sellable commodity.

sideeffffect··on Copyright vs. Copyleft (2007)
Yes, "copyleft licenses force or encourage devs to contribute back to the community" is a ridiculous cliche (or misguided, or misleading, to be more charitable), but for different reasons than you talk about.

The point of Copyleft (and the Free software movement in general) is to ensure that the user of a computer (and the software in it), a human being, is free -- meaning she can do with it what she pleases. Use if for whatever, study what it does, change it, share the original or modified version -- those are the four freedoms https://www.gnu.org/philosophy/free-sw.en.html . Humans can't be free, if they're not in control of the computers/software that they use.

The Free software community considers it unethical, if a cellphone owner or an automobile owner can't do with her device (including the software it runs) what she wants, even though she bought it with her hard earned money.

sideeffffect··on Anu: A sound, distributed version control systema
have a look at https://gitless.com/

A talk introducing the issues with git and how gitless improves upon them https://www.youtube.com/watch?v=31XZYMjg93o

sideeffffect··on Why Dark didn't choose Rust
F# has the expectation of reified generics (Don Syme, the language author created them for .NET before creating F#, after all), which are not a thing (yet?) on JVM.

Conversely, Scala has the expectation of (partial) type erasure as is done on JVM, and that's probably why the .NET port didn't get very far.

sideeffffect··on Why I Prefer Functional Programming
> I don't think we ever mentioned OCaml

How could you have not mentioned OCaml? The original Rust compiler was implemented in it. By this, Rust has a very clear (OCa)ML heritage.

It's meaningless to argue, whether Rust got ADTs from Haskell or OCaml, because the author (Graydon Hoare) had been clearly familiar with both and both got ADTs from ML, which is much older than either of them.

On the other hand, traits are a different story, those just Type classes with a different name, and that is a Haskell thing.

sideeffffect··on Java Turns 25 – Whats Next? [pdf]
Shenandoah is coming to OpenJDK 11. See my other comment for more details:

https://news.ycombinator.com/item?id=24571054

sideeffffect··on Java Turns 25 – Whats Next? [pdf]
Shenandoah might help you. See my other comment for more details:

https://news.ycombinator.com/item?id=24571054

sideeffffect··on Java Turns 25 – Whats Next? [pdf]
Shenandoah might help you. See my other comment for more details:

https://news.ycombinator.com/item?id=24571054

sideeffffect··on Java Turns 25 – Whats Next? [pdf]
20th October, OpenJDK 11.0.9 will be released, with full-fledged Shenandoah GC. It has _very_ low pauses and has the `-XX:ShenandoahGCHeuristics=compact` option, which will promptly give unused memory back to the OS (thus keeping the whole memory profile low).

Give it a try.

https://wiki.openjdk.java.net/display/shenandoah/Main

https://www.slideshare.net/jelastic/choosing-right-garbage-c...

https://twitter.com/shipilev/status/1308320432404168705

sideeffffect··on BitTorrent v2
According to the blog, BitTorrent v2 now tightens the possible block size to power of 2. But does that still allow for the blocks to be variably sized and created by, for example, a rolling hash-based chunker, like Buzzhash or Rabin?

I'm asking, because this would allow for sharing of big files across swarms, even though the files might be slightly different.

← PreviousPage 4 of 6Next →