HNHacker News
TopNewBestAskShowJobs

evanrmurphy

605 karma · joined February 24, 2010

submissionscomments
evanrmurphy··on HTML5 Speech Recognition (in Chrome)
Your line of code is so long it's causing this Hacker News comments page to have horizontal scrolling! I've never seen that before. :)

In case you didn't know, HN will format code if you prefix it with two spaces like this:

  document.querySelectorAll('textarea, select, input:not([type="' + notAllowed.join('"]):not([type="') + '"])') (results in `textarea, select, input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="submit"]):not([type="image"]):not([type="reset"]):not([type="button"]))`)
It can preserve indentation too:

  document.querySelectorAll(
    'textarea, select, input:not([type="' 
    + notAllowed.join('"]):not([type="') 
    + '"])')
evanrmurphy··on Introducing the New Profile
> One thing that's fascinating me is how they're letting this update deploy virally, by itself.

Are you saying it's opt-in only for everyone? My friend got the new profile automatically, though I did not. I see that I can choose to get it manually, but the FAQ also says you cannot revert.

Perhaps I've misunderstood your comment. I would be really impressed if the feature had total viral deployment (i.e. opt-in only for everyone), and if it allowed you to change back to the old profile at will.

evanrmurphy··on Ask HN: What is the Holy Grail for Software Engineering?
Vinge's "superhuman intelligence" rhetoric bothers me because it suggests that intelligence is a one-dimensional quantity. I don't think this makes sense except in the context of specific domains. For example, a basic calculator has superhuman intelligence when it comes to arithmetic, because it can evaluate arbitrary expressions much faster than a human can and doesn't make mistakes. But it's dumb about everything else.

Update: The child comment by binaryfinery points to where Vinge addresses this. Sorry, I failed to add the disclaimer that I only skimmed the article.

evanrmurphy··on Ask HN: What is the Holy Grail for Software Engineering?
To make software so extensible that you never have to rewrite it, or so painless to rewrite that you never mind.
evanrmurphy··on Ask HN: What is the Holy Grail for Software Engineering?
> There are a lot of things wrong with this analogy

I think so. As a rule, when something can be developed incrementally rather than planned and engineered, it should be. This makes mistakes less expensive, allowing you arrive at a satisfactory end result in a fraction of the time.

This is one of the huge advantages of the web over desktop software. Initial delivery to the desktop and subsequent updates cost significant time and headache. Redeploying to the server is just a matter of running a script.

evanrmurphy··on Ask HN: What is the first thing you do when trying a new programming language?
Typically I'm not patient enough to learn a new language very systematically, so instead I find myself following a pattern like this:

1. Hear about how great the macros are that Lisp has or the monads are that Haskell has enough times that I decide I need to try it

2. Independently have the idea for some new weekend project / mashup / potential startup and start obsessing about it

3. Persuade myself that this new language and new project are a match made in heaven and compulsively try to build the one with the other while furiously multitasking through tutorials

4. Get a little wiser and more sober about both of them through the experience

5. Hear about how great the asynchronous I/O is that node.js has...

evanrmurphy··on Ask HN: What is the first thing you do when trying a new programming language?
Speaking of which, from the OP:

> what is the first thing you write...

evanrmurphy··on Why Emacs is great - SLIME repl for developing in-browser javascript
Thanks for sharing, I didn't know about pabbrev-mode! This should help me show the IDE guys that Emacs can still dance. ;)
evanrmurphy··on Why Emacs is great - SLIME repl for developing in-browser javascript
I was a vim user and made the switch to Emacs. After finding out about Viper [1] I had to try it. If what you love about vim is the genius key bindings and modal editing, you don't really have anything to lose.

In that sense, you could say I never did switch to Emacs, since I never really got fluent in the default key bindings for basic editing in Emacs (always use the vim/Viper ones). So when I'm in an unfamiliar environment that doesn't have my personalizations, I still load up vi or vim before Emacs. :)

---

[1] http://www.delorie.com/gnu/docs/emacs/viper.html

evanrmurphy··on My first tiny "weekend project": readable text hosting. Useful?
> Why not expand on the concept...

Well I'm glad he didn't wait to show it until after he'd expanded on the concept. This is a great example of software that does one thing and does it well.

evanrmurphy··on Ask HN: Designing a Parenscript alternative
Arrays will be supported using one of these forms:

  '(1 2 3)      => [1, 2, 3]
  ([] 1 2 3)
  [1 2 3]
Objects with one of these:

  ({} a 1 b 2)  => {a: 1, b: 2}
  {a 1 b 2}
There's also the possibility of bringing ideas from David A. Wheeler's sweet-expressions (http://www.dwheeler.com/readable/). If curly braces are used for object literals, then the curly infix notation could not be borrowed, but there would still be an opportunity to borrow prefixed grouping symbols, e.g. f(x), and significant indentation:

  $("#something").click(function()
    alert("I was clicked!"))

  => $("#something").click(function() {
       alert("I was clicked!");
     });
evanrmurphy··on Ask HN: Designing a Parenscript alternative
Sibilant (http://sibilantjs.info/) and lisp.js (http://lisp-js.posterous.com/lispjs-a-lisp-for-nodejs-0) are two related projects.
evanrmurphy··on Ask HN: Designing a Parenscript alternative
Thank you for all your feedback so far. Is there anything about the existing lisp-to-js compilers that you wish was different?

I've just added a piece about the dot operator to the examples. I don't think any of the existing compilers have tried this approach.

evanrmurphy··on Ask HN: Designing a Parenscript alternative
do is intended to be like do in Arc or Clojure or progn in Common Lisp. It is not supposed to be a loop. Does this clarify or have I misunderstood your comment?
evanrmurphy··on Ask HN: Designing a Parenscript alternative
Infix and unary operators are pretty straightforward, since they're just prefix versions of their JavaScript counterparts:

  (&& x y)    => x && y
  (|| x y)    => x || y
  (+ x y)     => x + y
  (- x y)     => x - y
  (* x y)     => x * y
  (/ x y)     => x / y
  (% x y)     => x % y
  (+= x y)    => x += y
  (-= x y)    => x -= y
  (*= x y)    => x *= y
  (/= x y)    => x /= y
  (%= x y)    => x %= y
  (= x y)     => x = y
  (== x y)    => x == y
  (=== x y)   => x === y
  (!= x y)    => x != y
  (!== x y)   => x !== y  
  (! x)       => !x
  (++ x)      => ++x
  (-- x)      => --x
  (. x y)     => x.y
While the dot operator's base form should be a prefixed s-expression like all the others, it may be awkward to use in practice:

  (. (. ($ "body") (addClass "hidden")) (hide))
  
  => $("body").addClass("hidden").hide();
Since the dot operator is so common in idiomatic JavaScript, I propose allowing it to be infixed as a special case:

  ; expands to the above prefixed version

  ($ "body").(addClass "hidden").(hide)
For blocks we use a wrapper function rather than the curly brace block so that lexical scoping for variables can be ensured:

  (do (= x 5)   => (function() {
      (++ x))        var x;
                     x = 5;
                     return ++x;
                   }).call(this); 
               
The ternary operator:

  (?: x y z)   => (x ? y : z)
Perhaps we can create a useful distinction between the ternary operator and if-statements by giving if implicit do (just as cond has implicit progn in Common Lisp), but I'm not sure what the most elegant solution is. Thoughts?

Functions:

  (function)              => (function() {});
  (function ())           => (function() {});
  (function ()            => function() {
    (+ 1 1))                   return 1 + 1;
                             };
  (= foo (function ()     => var foo;
           (+ 1 1)))         foo = function() {
                               return 1 + 1;
                             }
  
We could build a simple unhygienic macro system using the traditional quote ('), quasiquote (`), unquote (,) and unquote-splicing (,@) operators, as well as rest parameters (&). Here's how you might define a macro called unless:

  ; macro definition

  (mac unless (x & args)
    `(if (! ,x) ,@args))

  ; example usage

  (unless true
    (alert "Won't be executed"))

  ; expands to:

  (if (! true) 
    (alert "Won't be executed"))

  => if (!true) {
       alert("Won't be executed");
     }
More coming...
evanrmurphy··on Sweet-expressions: A readable format for Lisp-like languages
> Two tendencies combine to make "parentheses" the Lisp topic that in sheer quantity dwarfs all other Lisp topics added together

Parentheses (and along with them s-expressions and macros) are one of the few characteristics still unique to Lisp. Most of the other features - including GC, dynamic typing, first-class functions and lexical scoping - are now shared with other programming languages as well.

evanrmurphy··on Sweet-expressions: A readable format for Lisp-like languages
Update: The page at http://www.dwheeler.com/readable/ appears to be the project's homepage.
evanrmurphy··on Sweet-expressions: A readable format for Lisp-like languages
I would really like to know more about these past proposals for conventional-looking syntax. I already know of a few, including the OP and SRFI 49 [1]. Could you offer any additional reading on the subject?

Some quotes from a different page on the OP's site [2] suggest that even some experienced lispers can see value in conventional syntax:

> I've used Lisp my whole programming life and I still don't find prefix math expressions natural. - Paul Graham

> After 13 years of doing Lisp and 3 or 4 years of Python, I agree: I prefer writing Lisp, but Python is easier to read. - John Wiseman

Personally, I hold no aversion to the parentheses. But I can see some advantages/uses for a more conventional syntax. Also, it's a fun problem. :)

---

[1] http://srfi.schemers.org/srfi-49/srfi-49.html

[2] http://www.dwheeler.com/readable/

evanrmurphy··on Sweet-expressions: A readable format for Lisp-like languages
This touches on the core of my enthusiasm about sweet-expressions. I'd like to make a "SweetScript" that compiles to JavaScript (via some lightweight lisp) and could essentially serve as a CoffeeScript with macros.

Would you find such a tool useful? What challenges would you foresee facing such a project?

evanrmurphy··on Ask HN: which obscure Github projects have you found useful?
Not sure how obscure these would be here (I first learned about them on Hacker News), but I've found Backbone.js and Underscore.js to be extraordinary projects.

Links:

http://documentcloud.github.com/backbone/

http://documentcloud.github.com/underscore/

evanrmurphy··on Wi-Fi Makes Trees Sick, Study Says
I'm troubled that this comment was so ferociously downvoted. Of course as far as science is concerned, the burden of proof/evidence lies with those who make claims about the effects of low-energy radiation to make their case. But that doesn't mean your personal health strategy should work the same way. The skepticism tilts the other way here: Don't unnecessarily expose yourself to things you're not sure are safe. Why? Because you don't get repeated experiments with your own body.
evanrmurphy··on Ask HN/PG : Why are comments ordered like this?
Is it because pg's comment has a more developed (and karmaful) subthread?
evanrmurphy··on PG on the cover of Forbes
> Heh... completely wrong, but I suppose it's the best you can expect a non-techie/math nerd readership to get. Heck, it's probably close to the most you can expect the average programmer to get.

How would you explain the Y Combinator to the Hacker News readership?

evanrmurphy··on PG on the cover of Forbes
Slipping a link into the headline to (presumably) your startup, even if it is inside a "// not related" comment, is pretty tacky. You might even call it spam.

Update: Thanks for removing the link.

evanrmurphy··on PG on the cover of Forbes
I think this is a repeat of http://news.ycombinator.com/item?id=1831471
evanrmurphy··on Rails for Zombies - Learn Rails from the comfort of your browser
Just when I was thinking that there couldn't be an easier introduction than railstutorial.org + heroku.com.
evanrmurphy··on Dead Code Elimination for Beginners
Neat idea. Which subset of the language could be better optimized by interpreters?
evanrmurphy··on An Awesome Book
Or remove the

  <DIV style=" width:32000px;...
Goofy markup aside, it's a beautiful book. :)
evanrmurphy··on Quantitative Easing Cartoon
The presentation is over-the-top, but could someone help me assess the content? I'd especially appreciate input from people who have advanced knowledge of economics.
evanrmurphy··on The 18 things you must do when launching a new website
Yes. And "must do" qualifies as a gratuitious adjective in this case.

Consider Things to do when launching a new website as a revision.

← PreviousPage 4 of 8Next →