News for hackers. Stuff that matters.

damncabbage

Re:Sketches of Elixir on Saturday December 29, 2018 @02:06AM (#18782398)
Relative to Ruby it has more upfront checking of some things. In Elixir, calling a function that doesn't exist or with the wrong number of arguments is something that will error out at compile-time; with Ruby, you don't find out until you run the code with the bad call.

I agree, though, that compared to Haskell and Rust it doesn't give you much. Dialyzer is (intentionally) a fail-open checker that doesn't allow expressing generics; I've had a rough time getting it to tell me my code is wrong. Credo is (intentionally) just a style linter. "Just let it crash" isn't useful when you're talking about code that is going to break because of its structural incoherence (a class of errors type-checker are good at catching), and not because of transient errors in external dependencies.

Re:Why Johnny Can't Code Good [video] on Wednesday October 18, 2017 @01:25AM (#15497071)
> I checked out our shared Twitter history, we talked a fair bit in the past but I wasn't able to find _anything_ like this.

> I mean this sincerely — are you _sure_ you didn't get me confused with someone else? I was definitely a dick from what I can see from the Twitter history and I apologize. However, I cannot remember and cannot find myself ever saying or implying something as horrendous as what you're describing here.

https://twitter.com/bitemyapp/status/477359528510382080

  [@bitemyapp] @KirinDave my first workflow video is up to 
  1,535 views on Youtube so far. Who knows how many people 
  have used my guide. I'm feeling good.

  [@KirinDave] @bitemyapp It is not about your traffic, it is 
  about their excitement. Get over yourself.

  [@bitemyapp] @KirinDave Drinking the haterade tonight. Some 
  of those pregger hormones transfer over?
  
  Should ramp up theft of Clojure library authors >:)

  [@KirinDave] @bitemyapp Yeah I'm hysterical that's real cool.

That covers a portion of the claim. (I'm trying to stay out of actually passing judgement on bitemyapp or his ">"-quoted defence or KirinDave's earlier claim.)
Re:Announcing TypeScript 2.2 on Wednesday February 22, 2017 @08:04PM (#13710766)
There's also comments support in Flow directly, but it's sadly (but understandably) hideous:

  function somefunction(somestring/*: string*/)/*: boolean */ {
     var ret/*: boolean */;
     ...
     return ret;
  }
(See https://flowtype.org/blog/2015/02/20/Flow-Comments.html)
Re:Announcing TypeScript 2.2 on Wednesday February 22, 2017 @07:53PM (#13710716)
> It falls short on many things TS would immediately flag

I'm kind of curious what you've run into personally. Having a dependency without any type-defs get silently treated as `any` is my own beef, but I haven't hit much else yet.

(Some type-defs' use for `any` also gets my goat, such as Promise's catch argument and some of the lodash functions, but I'm considering that a separate thing.)

​

> And honestly, some of the decisions around the language just feel strange. Not knowing what kind of bool to use [0] is pretty emblematic of where it is going as a language.

This is more an existing JS weirdness (`true`/`false` vs `Boolean()`); Flow doesn't mess with runtime semantics, only adding a layer that you check with then strip out.

And TypeScript has the same thing:

  var a: boolean = new Boolean(1);
  
  // Produces:
  // NewTypering.ts(29,5): error TS2322: Type 'Boolean' is not assignable to type 'boolean'.
It means restricting to where you can perform IO actions, eg. printing to a log, writing to a shared area of memory, etc.

Haskell does this by representing IO actions as values, eg. "IO String" (something like "IO<String>", for people more familiar with that syntax), representing an IO action that, when later evaluated, will yield a string that you can use in subsequent actions.

Haskell's "main" (entry-point) function is a value of type "IO ()" (IO of a value representing nothing useful; you don't get anything out of it, so you just have a nothing placeholder). When a Haskell program is run, it ostensibly (hand-waving here) takes that IO value and interprets it, performing the action IO.

You have functions like putStrLn (print a line) that takes a String, and returns an "IO ()" . Accordingly, if you have

  main = putStrLn "Hello, World!"
... you have a value that lines up with the expected return value of main "IO ()". More complicated examples, like

  main =
    readLn >>= (\x -> putStrLn ("Hello, " ++ x))
... are doing the same thing (checking the types line up), just with more moving parts (the Monad thing you mentioned, which we're using to relate the "read line" function with the "print line" function).

The key bit is that it's just "IO Blah" values standing in for IO actions, and like jigsaw pieces, these IO-returning functions only fit together where the types line up, restricting how you can use them.

Monads are tangential to this; the type-checking of that jigsaw puzzle is what matters here.

Re:Parsing JSON is a Minefield on Wednesday October 26, 2016 @09:10PM (#12802159)
A list of items in an array. Some items in that list are of particular note.

(Say you have 15 items in an array. For whatever reason, such as you not being in control of the expected input structure of whatever you're giving this JSON to, you have them grouped with comments at the top of each block.)

Re:Frege – a Haskell for the JVM on Sunday March 06, 2016 @07:09PM (#11236301)
> I've used the Haste compiler which IS Haskell that supports ALL GHC extensions except TemplateHaskell, supports the Cabal build tool and in practice it has its own ecosystem; most of Hackage will not compile on it.

As someone who's standing on the precipice of GHCJS, Haste and PureScript, I'm very curious to hear about your Haste experiences in this regard.

(I've been using PureScript in my side-projects for a bit. For the sake of completeness of this list, I've tried Elm and am not interested.)

Re:How We Get Things Done (2015) on Wednesday February 10, 2016 @07:44AM (#11072331)
Agreed; HipChat is unfortunately a bit terrible about this. I'll often "lose" a notification from someone when I'm offline: it sends an email, yep, but the chat client itself loses the "unread message" bubble. I have to make sure I check email on every reconnect.
Re:Sit/Stand Desk: IKEA Skarsta Review on Friday January 29, 2016 @10:56PM (#11000402)
I'd be cautious: the range is too small for me (6'1" / 188cm). On a regular desk that suits me, it doesn't go high enough, and if you prop things on the desks up a bit, you then need to remove them when you lower it.

(It's also a bit wobbly, which isn't great, but probably expected.)

Re:Why ML/OCaml are good for writing compilers (1998) on Friday December 11, 2015 @09:52PM (#10721601)
> ... being signed in is in-memory state.

Can be in-memory state. Everything beyond toy-sized I've ever worked on has externalised this sort of state to a database of some kind, if only so you can run a second copy for the sake of failover. I don't believe your example is relevant.

Re:Gradual type checking for Ruby on Thursday April 09, 2015 @01:11AM (#9345878)
In case the question is actually "Why not 1.9.3?", it's likely because 1.9.3 is End Of Life, and doesn't even get security upgrades now:

https://www.ruby-lang.org/en/news/2014/01/10/ruby-1-9-3-will...

https://www.ruby-lang.org/en/news/2015/02/23/support-for-rub...

I recommend reading this (or at least pages 4-6 if you're in a rush) and the footnoted sources:

https://docs.google.com/document/d/1soIYek-YEIvqtu9brv3ecdPb...

Re:Be My Eyes – Lend your eyes to the blind on Friday January 16, 2015 @02:55AM (#8897696)
The iPhone has VoiceOver, and there are bluetooth Braille keyboards/displays for typing.

This page goes into a bit more detail: https://andreashead.wikispaces.com/How+Do+Blind+People+Use+a...

To just see the content on the page, paste this into the console:

    $('body').append('<style>.lesson,.post{visibility:visible;}</style>');
(I enjoyed reading the content, but found it infuriating to skim.)
Re:Adobe joins the Chromebook party, starting with Photoshop on Monday September 29, 2014 @11:26PM (#8386630)
"If network connectivity is lost, you will need to launch a new session."

As an Australian, I fear this is yet another one of those things we won't be able to use on our spotty 250KB/s connections.

Re:A live streaming platform dedicated to code on Sunday September 14, 2014 @03:09AM (#8314707)
I'd love to see how this goes. :D

I recommend having a read of this other discussion thread further up the page: https://news.ycombinator.com/item?id=8312701

This won't do anything for you there; it just collapses a Class and a record ID down into a string for you (and then pulls it back out of your database later with a GlobalID::Locator.locate(string) call).

It's not full-record-serialization, and it can't bring back deleted records for you.

(See https://github.com/rails/rails/tree/master/activejob#globali... for an example.)

Re:Hotel fines $500 for every bad review posted online on Monday August 04, 2014 @08:16AM (#8131361)
Spooky23 is being sarcastic.
Re:Critiquing Facebook's new PHP spec on Thursday July 31, 2014 @10:39PM (#8118158)

  I'm of the opinion that languages around the 10 year mark 
  (which PHP is obviously well past) really ought to focus on 
  becoming the best X they can be, rather than chasing the 
  tail lights of constantly-moving best practice.
Would that include not adding:

  * Anonymous functions and closures
  * Namespaces
  * Late static binding
  * Dynamic dispatching to static methods
  * Rackup/SimpleHTTPServer-like web server
  * "finally" in exception-handling
  * Being able to call foo()[0] instead of the clumsy
    assign-then-dereference two-step.
What does "the best PHP it can be" mean? Anonymous functions (for example) are arguably way outside the style of the PHP from ten years ago, but they're tremendously useful.

(I used to use PHP. I dislike it as a language, but I have nothing against them continuing to improve it like they have over the last nine years.)

PS: PHP already supports threading via a PECL module. http://php.net/manual/en/class.thread.php

Re:Show HN: Papa Parse 3 on Wednesday July 16, 2014 @10:34AM (#8042198)
Slight off-topic, sorry – I'm having a hard time reading the text on the photo background: http://i.imgur.com/StACWqu.png
Re:Living in a Fool’s Paradise on Sunday July 06, 2014 @10:43PM (#7996739)
This is also an excellent (and very long) piece that does the same: http://techcrunch.com/2014/04/14/sf-housing/
Re:3d scene representation in Haskell on Saturday July 05, 2014 @04:49AM (#7991378)
I think there may be a typo with the first example:

  newtype ID a = ID Int deriving (Eq,Ord,Show)
Should possibly just be:

  newtype ID a = ID a deriving (Eq,Ord,Show)
Re:Debian is switching back to GLIBC on Wednesday June 18, 2014 @10:11PM (#7914052)
Re:Flappy Bird in Swift on Tuesday June 03, 2014 @06:21AM (#7839158)
Re:Git 2.0 on Wednesday May 28, 2014 @09:02PM (#7814012)
I can almost understand with something like Subversion (which seems to subtly skew the entire development process to work around the friction some of its basic operations introduce), but not even Mercurial? :(
Re:Tail Calls, Optimization, and ES6 on Sunday May 25, 2014 @01:27AM (#7795562)
And also apply this patch, if you're using MRI (the C implementation, and the most common Ruby runtime): https://gist.github.com/plexus/11201946

Older »