HackerTrans
TopNewTrendsCommentsPastAskShowJobs

Sonata

no profile record

Submissions

Quine – Open-Source Streaming Graph for Event-Driven Applications

quine.io
8 points·by Sonata·4 lata temu·0 comments

Seven Days of OCaml

davidtimms.github.io
4 points·by Sonata·4 lata temu·0 comments

comments

Sonata
·2 lata temu·discuss
Great to see this moving forward.

It does seem a bit of a mixed message to enable this by default while still saying the functionality is experimental. I fear many people will take this as a signal to start using the feature in production, then find a later Node.js update breaks things if the behaviour changes.
Sonata
·2 lata temu·discuss
The approach taken to this problem by Cats Effect (a Scala concurrency library) is interesting. It allows cancellation of a fiber from outside, but let's blocks of code be marked as uncancelable. If a fiber is cancelled while executing one of these blocks, it will complete the block before cancelling. This protects against cancellation in between two operations which leaves the program in a broken state.

The drawback of this approach is that the onus is on anybody writing code which might be cancelled to correctly mark the uncancelable regions.
Sonata
·2 lata temu·discuss
As long as they don't make them mutable!
Sonata
·3 lata temu·discuss
Nice to see some Scala content on HN.

Hope he finishes the book.
Sonata
·3 lata temu·discuss
Here a common example:

Given the following tables:

  CREATE TABLE person (
    id INT PRIMARY KEY,
    name VARCHAR NOT NULL
  );

  CREATE TABLE pet (
    id INT PRIMARY KEY,
    name VARCHAR NOT NULL,
    owner_id INT NOT NULL
  );
It is common to want to join them, like so:

  SELECT owner.id, owner.name, COUNT(pet.id) AS numberOfPets 
  FROM person AS owner
  LEFT OUTER JOIN pet ON owner.id = pet.owner_id
  GROUP BY owner.id
This doesn't work in standard SQL, because all columns in the SELECT list have to either be aggregated or included in the GROUP BY. owner.name is neither. That is a bit silly though because we know each result row will only have one unambiguous value for the owner name, since the GROUP BY is on a unique column from the same table as the owner name.

We can solve this with ANY_VALUE:

  SELECT owner.id, ANY_VALUE(owner.name) AS name, COUNT(pet.id) AS numberOfPets 
  FROM person AS owner
  LEFT OUTER JOIN pet ON owner.id = pet.owner_id
  GROUP BY owner.id
Sonata
·4 lata temu·discuss
Youth culture is alive and well.

And as for music subcultures, I'm a fan of several genres which have distinctive fashions, art styles and world views - rave, psytrance, drum and bass, hardcore punk, metal. It's great to go along to gigs and meet people from those different groups.

I think what has changed is that those subcultures are no longer exclusive to young people. It has become more acceptable for people to be outwardly "alternative" later in life, so people remain in the cultures they found when they were young.
Sonata
·4 lata temu·discuss
I'm glad people are working on this problem. Typescript's compiler performance is certainly a weakness.

Other commenters have rightly called out the complexity of the type system as the reason why this is difficult. The other reason is that Typescript does not have a formal specification. The tsc compiler is the only reference for the correct behaviour. It would be great if the official compiler and these reimplementations could share a common test suite to ensure compatibility.
Sonata
·5 lat temu·discuss
Interesting. I'm not aware of any other lazy dynamic languages. I would assume it is difficult to optimise such a combination.