News for hackers. Stuff that matters.

timcameronryan

A high-priority housing program is how you implement a human right for shelter.

This isn't some paperclip maximalization requirement you adhere to the social contract, and under the wrong conditions will force people into house-building labor camps. Human rights are how you reason about resource allocation. You have a right to a trial by a jury of your peers, but that obviously doesn't mean a judge must preside over your case that same day by threat of force. We can recognize physical realities, while still understanding that if we wanted to, we could provide a social safety net that includes a place to sleep.

> If your country ran out of money, if the builders all started working for foreign companies

If your country runs out of money, many human rights are probably in danger.

There's no shortage of builders. You can just compensate those workers with taxes. If you think taxes are also a form of slavery, that's a different discussion.
Re:Pandora Acquires TicketFly for $450M on Wednesday October 07, 2015 @04:37PM (#10348905)
Perhaps it's usage by time? i.e. Pandora left on in the background.
Re:LibreSSL, and the new libtls API on Friday October 02, 2015 @02:04PM (#10320183)
I recall a lot of renewed energy a year ago into improving OpenSSL, including funding and support. Has that panned out as I would have hoped? LibreSSL improvements are highly visible (and exciting) but I expect I would have overlooked any OpenSSL improvements.
Re:TodoMVC in Rust on Wednesday September 23, 2015 @02:02PM (#10266756)
I can't wait for a JSX crate on Cargo.
Re:TodoMVC in Rust on Wednesday September 23, 2015 @02:01PM (#10266750)
I was impressed too. I think the key is that it injects all of the HTML at once. Compare that to e.g. the Backbone.js implementation which uses progressive enhancement: http://todomvc.com/examples/backbone/

The code can be optimized further with Closure Compiler, but I wonder if that decreases startup speed.

Re:TodoMVC in Rust on Wednesday September 23, 2015 @02:00PM (#10266736)
I'd love to refactor this to not need RC's for DOM nodes. I'm new to Rust, but I expect there's a ton of room for refactoring.
Re:TodoMVC in Rust on Wednesday September 23, 2015 @01:58PM (#10266725)
This uses a deeply hacked Rust stack. Take a look at this: https://github.com/tcr/rust-webplatform/blob/master/setup.sh It's also using a version of Rust that's pre-1.0.0.

Progress is being made on making this first class though: https://github.com/rust-lang/rfcs/issues/604

Re:TodoMVC in Rust on Wednesday September 23, 2015 @01:57PM (#10266715)
It is nasty code! I started refactoring before I hit some struct-alignment bugs (fixed on later Rust versions): https://github.com/tcr/rust-todomvc/blob/tcr-wip/src/main.rs

The parent navigation needs to be replaced by a jQuery-like .ancestors() macro.

This was an MVP so I wasn't focused on code quality over features; but I'm also learning Rust for the first time, so it came out less than impressive :)

Re:Introducing Octokit on Friday May 31, 2013 @07:15PM (#5801817)
The Octocat used here and in the API control panel[1] reminds me of robot anime (Gundam Wing, etc.) or perhaps Speed Racer. I don't think it's meant to be warrior-like, but futuristic.

[1] https://a248.e.akamai.net/assets.github.com/images/modules/b...

Re:Apple II software still being sold on Sunday April 21, 2013 @04:20PM (#5586258)
Programming for the Atari was one of my favorite coding challenges. I think the web offered a lot of similarities in the past decade (trying to make an unsuitable platform perform magic) and somehow jumping into 6502 assembly and trying to trick beautiful graphics out of the pithy TIA felt extremely satisfying.
Re:_why's site updated again on Thursday April 18, 2013 @05:21PM (#5573177)
Forked and made to support OS X: https://github.com/tcr/_why-spool-osx
Re:LLVM.js: LLVM Itself Compiled to JavaScript via Emscripten on Thursday January 03, 2013 @01:38PM (#5003790)
Makes me excited for a forthcoming Emscripten => Brainfuck compiler.
Re:LispyScript: A JavaScript With Lispy Syntax And Macros on Friday September 21, 2012 @12:42PM (#4554434)
I experimented with a CoffeeScript-like Lisp in JavaScript once. It's pretty opinionated, but provides interesting syntax possibilities (infix notation, non-significant parentheses and commas for clarity, JSON-compatible syntax): https://github.com/tcr/syrup

    range = fn: [i]
      loop: [i, r = []]
        if: (i == 0) r
          continue: (i - 1), concat: (i - 1), r
    
    print: range: 5                # [0, 1, 2, 3, 4]
Re:Show HN: We use Github Gists to store user data on Saturday April 21, 2012 @12:04PM (#3872107)
For specific audiences, using Gists as data storage is really useful. I did the same for my "reverse StackOverflow": http://askedtheinter.net/

Users own all their data, they can revise their answers, and other users can fork them; just like small Git repositories, and just the use-case that gists generally solve. Compare: http://timcameronryan.askedtheinter.net/q/1318314 with https://gist.github.com/1318314

Re:Colony, an experimental JavaScript-to-Lua compiler on Wednesday October 26, 2011 @04:08PM (#3160193)
Hey all, I'm posting this to HN to see if there's any interest in a full-fledged JavaScript port to Lua. Colony right now is a proof-of-concept, but there might be a real use case out there for embeddable JavaScript where solutions like V8 would simply be too large.

Since it's a source-to-source compiler, you can use Colony generally wherever Lua source is required. For example, I was able to follow the beginners tutorials of the Corona SDK (http://www.anscamobile.com/corona/, a cross-platform mobile SDK that uses Lua) by programming CoffeeScript instead, which was surprisingly fun.

This is reworked from my other project, IERange (https://github.com/timcameronryan/IERange).

Rather than include a full duplication of DOM Ranges for old IE browsers, this API normalizes the most important capabilities of DOM Ranges and TextRanges (getting/setting anchors, and directionality). This can be included in a JavaScript library without much overhead, and any other essential DOM Range capability (deleteContents(), setStartBefore(), etc.), can be duplicated as needed by working with the DOM itself.

Re:Mug: A New JavaScript compiler for the JVM on Monday January 10, 2011 @02:03PM (#2089358)
Much of the runtime has been developing by trying out existing code, then adding support gradually. Of course most of the code I tried out was ECMA3 compliant.

I expect to add in support for ECMAScript 5's Object extensions API (defineProperty, getters/setters) as Mug supports them internally, just as Mug already has a global JSON object. The features which could cause incompatibility with existing code is something I'd have to consider separately, so it depends when a majority of authors start writing ECMA5-compliant code (no function.callee, implicit this object bound to global, etc.)

Re:Mug: A New JavaScript compiler for the JVM on Monday January 10, 2011 @01:31PM (#2089263)
Sometimes. The primitive types Mug can work with are `double`, `boolean`, `String`, and `JSObject`. This allows arithmetic operations and conditionals to be compiled without wrapping objects, and actual object invocations to be autoboxed as they are in JavaScript (like "a = 10" vs "a = new Number(10)")

The gaudy part is that there is only one type of function signature, basically "invoke(Object, Object, Object...)" which means Mug has to convert doubles to Doubles and booleans to Booleans across function calls... so it's somewhat of a tradeoff.

Re:Mug: A New JavaScript compiler for the JVM on Monday January 10, 2011 @01:25PM (#2089244)
As al_james metioned, in order to emulate a dynamic language, you have to take a lowest-common-denominator approach. Thus all objects are of the type JSObject, which has functions for get() set() invoke() etc.-- basically a glorified HashMap+Runnable.

However, you don't need to wrap objects for arithmetic operations. At the moment Mug can determine the result of some types of expressions. If you're adding two doubles, it doesn't wrap the numbers before adding them. If you're calling (10).toString(), then it will autobox the number just as defined in the ECMAScript spec (the [[ToObject]] operation).

Deterction currently only works where types are explicit (a number literal will always be a number, etc.) The next step is to do type analysis on local variables, which will allow loops like for (var i = 0; i < 10; i++) { ... } to be compiled without wrapping primitives at all, greatly improving speed.

Older »