HN user

Apanatshka

127 karma

blog.jeffsmits.net

Posts5
Comments48
View on HN

I'm implementing different parsing algorithms (for programming language text to syntax tree purposes). There are so many papers published on different algorithms... I'm just slowly reading it all, and implementing the algorithms and improvement ideas, sometimes combining ones from different papers. At the moment I'm constraining myself to LR-based algorithms to not drown even more in the sea of publications.

I have a recursive ascent code generator with a bunch of optimisations that I wrote about [1,2]; it's a linear-time parser for LR(1) with reduced overhead. I have an RNGLR implementation (a polynomial-time parser for any context-free grammar), that's still a table-based interpreter like more LR-based parsers out there. I've extended that implementation with special code to handle cycles more efficiently. Some day, I'll take some time to write a paper on that and publish it. Currently, I'm trying to combine the two ideas and create a generalised recursive ascent code generator. If I succeed I'll write another blog post again, it's been a year since the last one...

[1] https://blog.jeffsmits.net/optimising-recursive-ascent/ [2]: https://blog.jeffsmits.net/optimising-recursive-ascent-part-...

Reading literature (academic and otherwise) on parsers, writing blog posts about what I learn, trying to implement the things I learnt. I've written about basic finite automata (for regular expressions), LL, LR (including the difference between SLR, LALR, and LR(1)), detoured into some optimisations for LR from the 80's, then generalised LR (RNGLR in particular). I'm now implementing these things, RNGLR is not easy to implement despite having understood it well enough conceptually to write a blog about it (https://blog.jeffsmits.net/generalised-lr-parsing/). I've read far more than I've written about, trying to keep that straight in my head as well / planning the next... probably year of writing ^^'

Is that legal in your country? In mine (Netherlands) there are way too many people with doorbell camera aimed right at the street even though it's illegal to record a public space like that. Most folks are ignorant about it though, or think that surely the internet-connected gadget sold by some anonymous corporation won't be abused....

An important and sometimes forgotten thing about democracy is that it isn't as simple as the majority rules. It's the majority rules while taking minorities into account. In a well functioning representational democracy this is kept in mind my career politicians. In a hybrid between representational and direct like in Switzerland, the population can overrule and just go with majority rule.

For example, the Swiss pension system is similar to others in Europe, where the current working population pay taxes almost directly towards pensions of the retired. Since this system will break down if taxes aren't increased like crazy or pensions lowered, politicians have been trying to change the system. But there are too many people soon to be retired or already retired that care less about their country's youth and future than their own pension, so they keep blocking changes. So every democratic system has its tradeoffs...

I learned this from a young Swiss when I was visiting Switzerland and praising their way of democracy. It was a few years ago though, so maybe this info is no longer accurate. And I didn't fact check, it was just an example brought up in casual conversation.

The article mentions Radiolab. I remember listening to a Radiolab episode about War of the Worlds, but that must have been a later revision, because in that episode they go into how the first airing of the play did not cause a panick, but other airings of the play in other places certainly caused panick and violence.

Still alive 6 years ago

That excerpt made me think of Romantically Apocalyptic, which is a... visual novel / web comic? I read it for a while, really enjoying the art and the strange and absurd conversations, characters and events. It felt a bit unplanned and all over the place though, but that might just be my prejudice towards web comics combined with the style of writing.

My Firefox on Android has a QR code scanner, I typically use that even when I know it's not a website. When you open a new tab and select the address bar you get to see the button for the QR code scanner.

I've seen a poster presentation at the student research competition of a PL conference where the student created a tool to do this after the fact on binaries. It looked quite promising, but I think preliminary results were single digit percentage speedup for most benchmarks. I'll have to see if I can find it again.

My Favourite Diff 6 years ago

A similar example is in a "filtering" operation. I mostly have this in functional programming where you pass a predicate to filter on. But what's the perspective of the filter? Are you filtering poison from your water, or are you sifting the water looking for gold nuggets. I prefer to use functions remove and retain (respectively) to be more explicit.

Projectional editors use that setup. Might be slightly different than what you have in mind since projectional editing is not great at text editing. But have a look at Jetbrains MPS, that's a language workbench for projectional editors.

I think multiple episodes including the season 2 christmas episode comment on brain computer interfaces in one form or another and they all seem realistic and scary to me. Best not use direct brain computer interfaces.

I researched this over a summer once by downloading the latest scientific papers on gaze tracking. The result were pretty disappointing to me. Then I figured I was doing this researching all wrong. Because I already knew from highschool biology that your eye does micro movements all the time to keep the retina stimulated and to keep a larger area in focus at the same time. So I opened wikipedia and looked up the smallest micro moments that the eyes do. Based on the angle of it and the average distance between your eye and the screen, it's easy to see that you can never replace the mouse with gaze for a pixel perfect pointing device.

However! If you think outside the box, you might get a fairly accurate gaze tracker and a different GUI design to get this to work. That vision (no pun intended) is more of a long term one. An easy short term use for eye gaze use would be automatically setting GUI window focus based on eye gaze. That already might save you a keyboard-mouse switch. As long as you have no more than four windows on your screen, you can make it work with the current tech already.

A Farewell to FRP 10 years ago

I'm similarly ambivalent. Though Elm and it's flavour of FRP were more of a hobby (I never turned into an academically valuable thing :) ), I was still very interested in the roots of the system and how to use and improve it. I know the change was happening already, that signals were not used much in the Elm Architecture; I also understand and applaud the simplification. But I'm still a little sad to see FRP go, it's an interesting idea and does have potential IMHO.

Thanks for the feedback :) I didn't know that about Rust's regex! Despite the note at the end that I wouldn't write more Rust automata code, I'm still a little tempted to try my hand at a Rust crate for automata related things. I'm not sure if I'm going to try that first or try to write the next post in the series...

Summary of the idea:

Add implicit arguments with some extra syntax. Whenever the argument is unambiguous, you can just not mention it, whenever it's ambiguous you add the argument to a function call. Modules provide the structs of related functions, so implicit module typed arguments are a good fit for "typeclass-like" functionality. The paper also mentions some nice extensions of importing implicits inside other modules.

If you know implicit arguments from Scala or Agda [0] or whatever other language, you get the mechanism.

If you know type classes from Haskell, you know the "goal" and the capabilities. Only this proposal requires less extension of the language, because you can disambiguate instances by supplying one by hand (basically implicits applied to "the scrap your typeclasses" approach [1]).

[0] http://wiki.portal.chalmers.se/agda/pmwiki.php?n=Docs.Implic...

[1] http://www.haskellforall.com/2012/05/scrap-your-type-classes...