Hacker Newsnew | past | comments | ask | show | jobs | submit | edgarbob's commentslogin

Are there any good starting places for learning the necessary type theory to understand this stuff? I really like the idea of extensible row types, but struggle with trying to understand the research papers.


Types and Programming Languages by Pierce. Available online if you search for it. Expresso appears to be, more or less, an extension of the toy language implemented in that book.



This looks pretty cool. It's nice to have an open source Rust game. Getting started developing a game in Rust is a bit rough, so having a reference like this is very helpful.


This is one of those things that will make Rust "feel" much more pleasant to work with. More ergonomic, I guess.

It often feels like you're fighting with the Rust compiler, and I think NLL will do a lot to reduce that friction.



Yes, this seems to be the right behavior for case-insensitive things like DNS names as well. If a user inputs one, preserve the case when you store it, but do case-insensitive comparisons.


This is really cool. It's surprisingly hard to find good examples of how to implement type inference.


If I remember right, TAPL (Types and Programming Languages by Benjamin Pierce) contains implementations for nearly everything that it talks about. So you can find another implementation of Hindley-Milner there.

I don't think it includes row typing though.


Yes, there are implementations for many of the type systems in the book. :)

https://www.cis.upenn.edu/~bcpierce/tapl/checkers/

The code is pretty elegant. I think it's intended to be clear enough for students in his classes to modify.


I think PLAI gets into it, but I've not read it. http://cs.brown.edu/courses/cs173/2012/book/


Does anyone know of a similar tool for XML? In particular, it would be cool to have a useful way to run xpath, and maybe xquery, from the command line. The tools I've found have unfortunate interfaces, e.g. they won't read XML from stdin.


Have you tried XMLStarlet[1]? It's my go-to for command line XML processing.

[1] http://xmlstar.sourceforge.net/


Even with libxml's xmllint you can do some xpath stuff: http://wiki.apertium.org/wiki/Xml_grep


I'd just use xml2json and then apply jq. Usually gets the job done. The benefit of that is that you only need to learn jq.

See this blog post I wrote a while ago for an example: http://jeroenjanssens.com/2013/09/19/seven-command-line-tool...


Most of the JSON conversions from XML get it all wrong though. XML is not really an object (dict, hash) based meta-schema. It's an array-based meta-schema. XML->JSON conversions should look something like this:

    [ {"tag":"something", "attributes": { ... }, "nodes": [ ...] }, ... ]
with nodes being objects with one key to indicate if the node is a text node or an element, and if a text node then a value, and so on.



I am not a huge fan of PHP, but you can do some useful stuff to XML using the PHP command line tool, provided you have the right libraries installed. I have run into situations where the package manager on a machine I'm using doesn't have an up to date xmlstartlet or xmllint, and have tidily gotten around this problem using PHP.



Hopefully Rust's approach to zero-overhead abstractions will alleviate a lot of the problems you run into in C++.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: