Readit News logoReadit News

Deleted Comment

Deleted Comment

_xhok commented on REST is the new SOAP   medium.com/@pakaldeboncha... · Posted by u/sidcool
_xhok · 8 years ago
REST has the same problem as object oriented programming. It's too skeuomorphic. Lots of web applications are wrappers around conceptually monolithic resources, so it's convenient to use a protocol that makes that assumption. But as soon as you need to nest resources, or perform some action that has nothing to do with CRUD, or do just about anything interesting, the metaphor begins to fall apart.

(That's also why OOP has all these "patterns." Many are just attempts to cope with the "object" metaphor falling apart. "Is" an AttackingRock a Monster, or "is" it an Obstacle? Hmm...)

Deleted Comment

_xhok commented on Lisp at the Frontier of Computation [video]   youtube.com/watch?v=f9vRc... · Posted by u/reikonomusha
sillysaurus3 · 8 years ago
The cool thing is, there's no interop. It's literally JS or Lua. Think of it like CoffeeScript -- there's no "interop" between CoffeeScript and JS. It's just JS.

You can see what each expression compiles to by passing it through (print (compile (expand ...)))

For example:

  > ((require 'leftpad) "foo" 5) 
  "00foo"
  > (print (compile (expand '((require 'leftpad) "foo" 5))))
  require("leftpad")("foo", 5)
And of course, you can use macros to shorten this

  > (define-macro see (x)
      `(print (compile (expand ',x))))
  (macro: function)
  > (fn (x) (+ x 1))
  function
  > (see (fn (x) (+ x 1)))
  function (x) {
    return x + 1;
  }
The best way to learn it is to read test.l and mess around with the expressions while running `make test` to see what breaks.

If you have questions, be sure to reach out or post them here. The maintainer is also quite responsive to opening new issues.

_xhok · 8 years ago
Also, you can compile a Lumen file to JS/Lua by running `lumen -c file.l -o file.js`. More info at `lumen --help`.
_xhok commented on Lisp at the Frontier of Computation [video]   youtube.com/watch?v=f9vRc... · Posted by u/reikonomusha
sillysaurus3 · 8 years ago
Rather than most popular, I propose using the most useful.

That'd be Lumen.

http://github.com/sctb/lumen

It's the only lisp that can interface seamlessly with any JS library you want. Just `npm i leftpad && LUMEN_HOST=node lumen` and type `(require 'leftpad)`.

  $ npm i leftpad
  $ LUMEN_HOST=node lumen
  > (require 'leftpad)
  function
  > ((require 'leftpad) "foo" 5) 
  "00foo"
Other lisps are nice, but they all try to build their own ecosystems instead of use existing infrastructure. So if you want to do webdev and run into a problem with the library, your only option is to fix it yourself or write your own, since most people don't use lisp for webdev.

That brings us to Clojure: the prima facie "lisp for webdev". It's a good lisp, but it forces you into non-optional immutability. That's a feature for some and a burden for others. And it's very difficult to transpile into JS. In an era where size and speed matter due to bandwidth concerns, this is a severe limitation.

That said, all of the lisps are a delight to use in their own way. Racket is fun to wrestle with, mostly to coerce it into doing what you want. SBCL is neat for doing archeology in -- you can run all kinds of interesting old programs. Elisp is fun because you can extend your editor to do anything you can imagine. Arc powers the website you're reading this on, and its underlying ideas are worth internalizing.

_xhok · 8 years ago
This is wonderful. Thank you for sharing! I've been putting off a JS coding project for some interview, which I now think I'll write in Lumen. Another pleasant surprise: it was written by the HN moderators.

Have you used this in any substantial projects?

_xhok commented on Ask HN: I'm a solopreneur and I feel demoralised    · Posted by u/ministrator
_xhok · 8 years ago
I used to be the same way.

Wake up at 5am, meditate, exercise, and shower before starting your day. Stop eating processed carbs and sugar. Get off the computer at 9pm and sleep at 10pm. Clean your room. Schedule sprints of work for yourself, drag yourself over to your chair, and force yourself to start typing anything. Talk to your friends more often. Set 1-3 large goals at the beginning of the day and explain to yourself why they're important.

There are lots of reasons you might be feeling this way, and it's different for everyone. Maybe you're disorganized, or you feel your work is too easy, or your health is bad. You'll have to find out which one it is by trying a lot of different things.

If after doing all this you still feel the same way, please seriously consider the very real possibility of clinical depression, and seek professional help.

_xhok commented on CoderPad – Interviewing Platform for Programmers   indiehackers.com/business... · Posted by u/NicoJuicy
_xhok · 8 years ago
CoderPad is really, really good. I've interviewed using a bunch of alternatives, and CoderPad is far and away the only one that works reliably all the time. It always cheers me up when a company tells me they're using it, because I know it won't lag, the vi keybindings will work, the built-in terminal will work, there won't be weird interface glitches, every language I need will be there, etc.

This sounds hyperbolic, but I've never wanted a feature during an interview and found CoderPad to lack it.

_xhok commented on In search of the perfect writing font   ia.net/topics/in-search-o... · Posted by u/ingve
_xhok · 8 years ago
I used to tell myself I couldn't code or write without the perfect font. I'd spend hours looking for it, and end up not getting any work done. When I finally did get around to actually working, five minutes in and I'd forget about the font completely.

I have a (rather lazy) friend who's been asking me to help him start a blog for years now. I've promised to after he produces his first block of content, and he keeps saying he can't write if he doesn't feel the design is aesthetically pleasing. If he'd spent his time writing instead of worrying about this, he'd have a crappy initial draft, several revised drafts, and probably something decent by now. But no, that prohibitively unattractive font!

It was nice of iA to write this up, and design posts are a fun read, but does anyone who's busy actually writing care about this?

Deleted Comment

u/_xhok

KarmaCake day1406August 18, 2012View Original