HNHacker News
TopNewBestAskShowJobs

Zalastax

213 karma · joined July 19, 2015

MSc thesis "Singly typed actors in Agda": http://studentarbeten.chalmers.se/publication/256251-singly-typed-actors-in-agda-an-approach-to-distributed-programming-with-dependent-types
submissionscomments
Zalastax··on Python in Visual Studio Code
I don't think the undo feature is built out well enough for it to be a great idea for you to switch to it. I tried to build an undo tree and saw that there is a granularity mismatch between the internal stack and yours. I think the API should be redesigned so that plugins can manage the undo stack but the team seems pressed on time so I gave up for the time being. The issue is still open so I'm hopeful they might come back to it.
Zalastax··on Why I never finish my Haskell programs
Yeah that's a better one (which I think is discussed (or a similar one) in Theorems for free!), but the wording of OP weasels itself out of that being a problem.

> any `b` in the result list _must_ have come from applying the function to some `a` in the input list.

Since there exists no a in [], the quoted statement holds! I find that really beautiful :)

Zalastax··on Why I never finish my Haskell programs
When discussing Haskell and theorems about its types it's common to simply ignore non-termination; if we don't ignore non-termination there's basically nothing we can say about Haskell programs at all.

Interested readers should check out Agda and Theorems for free!

Zalastax··on TypeScript at Google
TypeScript supports doing that as well :) https://github.com/Microsoft/TypeScript/wiki/Type-Checking-J...
Zalastax··on How I recorded user behaviour on my competitor’s websites
Instead of downvoting I'd love if you could reply instead...
Zalastax··on How I recorded user behaviour on my competitor’s websites
> I had this implemented for a very brief period of time (for ethical reasons) and then moved to one of my disposable domains where it still runs after five years and ranks really well, though for completely different search terms.

Am I reading this correctly? He's been doing this since 2013 and still wants to use the white hat card?

Zalastax··on Things People Eventually Learn About JavaScript Projects
How does it compare to using TSLint?
Zalastax··on Bitcoin, Ether Sink as ‘Sense of Panic’ Grips Crypto Investors
> One would be hard pressed to find a single priced good or service on this planet that doesn't respond to energy prices.

You don't have to look further than Bitcoin. The cost of producing Bitcoin is primarily the cost of wasted energy - how much energy should be wasted is determined algorithmically. Too low and you get arbitrage opportunities; too high and people stop mining.

Bitcoin pricing is not at all related to energy prices in the middle-to-long-run.

Zalastax··on Bitcoin, Ether Sink as ‘Sense of Panic’ Grips Crypto Investors
The thing is that the act of mining isn't actually providing any value, it just proves that you have wasted some amount of processing power. This is called proof of work and is a system set in place so that bad actors can't take control of the ledger without spending a large amount of money. The threshold for how much work you need to put in is adjusted automatically. If there was just a single machine in the system they could choose to mine very slowly and the system would eventually reach a very easy threshold.

What that means is that the threshold would be about ten times lower if electricity prices were ten times higher globally.

As you can understand, this is a big big waste - which is why alternatives to proof of work are researched heavily.

Zalastax··on 1/0 = 0
The post is not about whether this is a good choice for its users; the post is about whether there are nathematical objections to it. The author even writes that they don't agree with the engineering decision to define it like that, but they can't object with an appeal to mathematics. It lists three valid choices for handling division by zero and Pony picked one of them. My personal favorite is to shrink the domain but that's not supported in most languages and those that support it are often not meant for number crunching.
Zalastax··on 1/0 = 0
In Agda you have the choice of either making it truncate at 0 or constrain the domain to (a - b, a >= b) in which case you don't hve to define the function when a < b. This of course is only suitable for theorem proving at the moment, but research is being done on how to have proofs like a >= b without sacrificing performance.
Zalastax··on Show HN: Pts.js – A library for visualization and creative coding
It only matters in a positive sense. Being written in TypeScript signals that it uses modern features that makes the code easier to read, that it doesn't use too many strange dynamic features, and of course that there are type definitions available for other TypeScript users. Other users can use it like they would use any JavaScript library.
Zalastax··on Show HN: Pts.js – A library for visualization and creative coding
Cool! How does it compare (in vision and features) to p5.js and pixi.js?
Zalastax··on Show HN: Inko – A safe and concurrent object-oriented programming language
Mailbox types for unordered interactions require manual management of mailboxes (new/free) but the type system guarantees that you can't free a mailbox with messages still in it. Garbage collection is probably possible but it seems difficult.
Zalastax··on Show HN: Inko – A safe and concurrent object-oriented programming language
Thanks for the details! The question about channels stems from the fact that in pi-calculus it's possible to have different processes read from the same channel - making it unsuitable for distribution. Your implementation of channels seems to be extremely similar to what I did! Keep calling it channels ;)

One thing I didn't like with the approach of storing channel messages in the mailbox is that if you use the regular receive statement you might receive a message ment for the channel. In my work I had to be very careful and use selective receive all the time. My preferred solution is to give each actor multiple inboxes so that unrelated messages don't get conflated. I haven't had time to explore this yet but if you're interested in implementing it in Inko I'll be glad to help.

Zalastax··on Show HN: Inko – A safe and concurrent object-oriented programming language
I don't quite get how messages and method calls interact. Could the process intercept the method call by explicitly receiving or somehow influence the process module to do something else?

Channels are a great idea! What capabilities (send on channel/receive on channel) can you forward to other processes? As Cloud Haskell explain, in distributed systems we must not allow send on channel to be forwarded.

Regarding channels, both linear channels and mailbox types for unordered interactions are interesting ideas worth looking into.

Great project!

Zalastax··on Show HN: Inko – A safe and concurrent object-oriented programming language
At a quick glance it seems like you're adopting the Active Objects model, is that correct? What are your thoughts on protocol safety? Methods being static mean that we can't guarantee protocol adherence, but perhaps that's overkill?

There's a lot of interesting work going on in this field so to save you some research I suggest looking through at least the related works section of my thesis (see profile).

Zalastax··on Unit testing anti-patterns: Structural Inspection
Manually writing Enzyme tests looks dumb to me but what about Jest snapshots? Their only purpose is to detect changes to prevent accidental behaviour changes. There's very little work that needs to be done to maintain those tests so I want to think they provide value. An explicit git log of how the rendered view has changed seems useful to me - especially in a pull request.
Zalastax··on Actor Model of Computation (2010) [pdf]
I find this resource confusing and annoying to read. When performing my thesis research I wasted a bunch of time trying to make sense of Hewitt's writing. I think a big problem is that the term "actor model" is so overloaded that it almost becomes meaningless. The actors that Hewitt is talking about is not at all the same as Erlang or Akka. As an example I consider this quote from the text nonsensical "Actor systems can perform computations that are impossible by Turing Machines" or of very little relevance to the actor models we use for programming. This has been discussed at [0].

For an overview of different actor models I prefer, see "43 years of actors: a taxonomy of actor models and their key properties" [1]. Agha's book [2] is also very good and I'd also like to recommend "Mixing Metaphors: Actors as Channels and Channels as Actors" [3].

[0]: http://lambda-the-ultimate.org/node/5208 [1]: http://soft.vub.ac.be/Publications/2016/vub-soft-tr-16-11.pd... [2]: https://dspace.mit.edu/handle/1721.1/6952 [3]: https://arxiv.org/abs/1611.06276

Zalastax··on Elixir v1.7 released
It looks like they're on the right path! Seems pragmatic and usable.

Personally I don't think Scala is the right tool for the job. Once we figure this out we should design a special purpose language - this is too complex to expose as a library (bad error messages etc.); and while we're experimenting I think Scala's type system is not expressive enough - we need dependent types.

I hope to see someone continue in my spirits but based on "mailbox types for unordered interactions".

Versioning, upgrading and errors are really difficult problems. I think it should be possible to do upgrades in a typed setting but it will not come easy. We'll need to start simple here, e.g. upgrades that don't change any types.

Zalastax··on Elixir v1.7 released
That warms my heart!
Zalastax··on Elixir v1.7 released
My Master's Thesis is about this topic!

The related works section mention some languages that get fairly close to being actors with types (e.g. Pony), but you're right that we're not there yet.

The tricky thing is that we need types that evolve as messages are being sent - an actor might change behaviour when it receives a message. Academica is still figuring out the kinks of how to do that.

My work assigns a static type per actor and my conclusion is that that's decent - but quite annoying to program with and without the guarantee of deadlock freedom.

https://www.dropbox.com/s/lczrcqu2m9p6osv/Master_Thesis.pdf?...

Zalastax··on The everything-is-a-file principle – Linus Torvalds
Yes! Changing available methods/consuming data terms are virtually the same - the former can be modelled as having methods consume their object and returning a copy of it that has another type. My background is in distributed systems and there linearity has a big cost, which is why the research I mentioned needs to be done.
Zalastax··on The everything-is-a-file principle – Linus Torvalds
The problem with classes is that an object's available methods can change over time. E.g. a file object should not have a write method after having been closed. Ongoing research is trying to fix this problem (see Scribble, mailbox types for unordered interaction), but until then I'd say it's probably best to stick with dynamic messaging.
Zalastax··on Why Does Your Company Deserve More Money?
Chasing those numbers can be a fools game. I've seen money going down the drain because stakeholders wanted to stroke their egos. Instead of staying lean, and since there was money in the company to burn, a big sum was spent on ads to keep new users pouring in. It was a horrible sight.
Zalastax··on Haskell’s State monad is not a monad (2014)
The nice thing is that you can actually build stuff like web servers in a total language :) Using something called co-induction a total language can model things that are potentially infinite, e.g. a web server. Co-induction replaces the requirement that every function must terminate with the requirement that the next step (e.g. the next value of a stream) can be calculated in finite time. So, the event loop could be modelled using co-induction as long as long as the event handlers do not contain infinite loops.
Zalastax··on Learn you an Agda (2011)
Yes, it's possible but might require a lot of effort. For example, my thesis was about creating a system where actors send messages to each other and the system guaranteed that you could not send messages with an unexpected type to another actor. Extending that, you could create a system where messaging has to follow an exact protocol, ensuring that there can be no deadlocks. You can read my work here: https://www.dropbox.com/s/lczrcqu2m9p6osv/Master_Thesis.pdf?... and the code is here: https://github.com/Zalastax/singly-typed-actors
Zalastax··on Learn you an Agda (2011)
Verified Functional Programming in Agda is the best Agda resource available, but studying Idris via Type-driven Development with Idris will net you very transferable insights. These are research languages, so the ideas are extremely interesting but not production ready. What I like about working in Agda is: proofs are verified by the compiler (so I know when I've proved enough), dependent types blurs the lines between types and values in a way that makes expressing complex typing relations no bother at all, and that mixfix operators let you create some really neat syntax. (Aspiring) computer scientists will be well of taking a look.
Zalastax··on Console.table()
Neat! Very interesting ideas! The Vacuum package[1] seems like something you could look into if you want to explore Haskell. Good luck with your project!

[1]: https://hackage.haskell.org/package/vacuum

Zalastax··on Console.table()
At a quick glance it looks like it's targeted towards mutable data structures. Can it support (and would it make sense to support) immutable data? E.g. it would be nice to have a Haskell state monad that also visualizes its state.
← PreviousPage 2 of 4Next →