News for hackers. Stuff that matters.

Fixnum

Re:Applicative Functors on Monday August 11, 2014 @02:01AM (#8162130)
On the other hand, the burden of proof is on the library writer who creates the typeclass instance, not on the end user - possible largely thanks to purity - whereas programmers may expect to re-implement various patterns by hand.
Re:SR-71 In-Flight Breakup on Saturday March 08, 2014 @12:13PM (#7365685)
It could be related to StackOverflow displaying "Hot Network Questions" in a sidebar, some of which are from the aviation StackExchange, combined with the usual phenomenon of upvoted stories attracting similar submissions.

Incidentally, I find this sidebar extremely distracting; maybe it's time for a plugin/script to fix it.

Re:Julia, the One Programming Language to Rule Them All on Monday February 03, 2014 @03:02PM (#7173075)
Julia seems nice, but the fact that the developers don't care about TCO is annoying and vaguely reminiscent of Python. If this were added, not only would many algorithms become more natural to express, but it'd go to the top of my list as a recommended first language (instead of Scheme or Lua).
Re:A list of free programming books on Saturday October 12, 2013 @05:12PM (#6540339)
They're not similar at all. FoCS is mostly about introductory programming and data structures (with a tiny bit about automata). Sipser's book is about computation and complexity - it's comparable to Hopcroft and Ullman's Intro to automata theory, languages, and computation, for which Ullman recommends FoCS or equivalent as a prerequisite.
Re:SICP translated to JavaScript on Saturday September 14, 2013 @12:07PM (#6386022)
Actually, Scheme is more accessible than ever before. If installing MIT Scheme and Edwin/Emacs is too difficult, now there's Racket-SICP, which allows you to program with DrRacket, a beginner-friendly graphical IDE, and actually comes with implementations of some parts of SICP that MIT Scheme omitted, like the picture language and (afaik) some concurrency primitives.

Is Scheme really decreasing in usage? Sure, in recent years there have been high-profile moves to Python at MIT and UCB, but I don't know of any hard stats on worldwide Scheme usage. Not that it matters.

Re:Programming Without Variables on Friday September 13, 2013 @11:37AM (#6381152)
For one thing, you generate as few as possible by aggressively fusing away intermediate lists (at least if your language is pure).

Also, the garbage collector will often move lists into contiguous region(s) of memory.

More to the point, though, sometimes a list is the appropriate data structure for a problem (like returning all intermediate results from the Collatz call, where you don't know how many there will be). Sure, you could use an array and double its size every now and then, but you're doing an awful lot of violence to your program just to handle something the runtime could take care of for you :)

And yes, I know there will be a slight performance penalty under many circumstances.

Re:Google knows nearly every Wi-Fi password in the world on Friday September 13, 2013 @11:27AM (#6381085)
The point is you're supposed to use truly random word combinations since those are at least memorable.

  $ wc -l /usr/share/dict/words
  119095
  $ python -c 'print(119095 ** 4)'
  201175048646341950625
  $ python -c 'print(85 ** 10)'
  19687440434072265625
So, even if your target is known to be using this scheme in pure form, this has more entropy than a completely random 10-digit password (assuming ~85 characters) -- and who would actually be using such a thing, except someone using a password management program - who could just as easily be using a 20-character random password?

So even if it becomes known, it's an improvement on what users are doing now.

Re:Quark: A secure Web Browser with a Formally Verified Kernel on Sunday September 08, 2013 @04:59PM (#6350307)
Re:Quark: A secure Web Browser with a Formally Verified Kernel on Sunday September 08, 2013 @12:07PM (#6349160)
For imperative languages, the most popular approach to formal proof is to add partial correctness annotations in an axiomatic semantics such as Hoare logic. I've heard that Microsoft does this to verify many properties of the Windows kernel. (I think the most popular tools are 3rd-party and proprietary at the moment.) Of course, finding the right theorems to write down is not easy either.

There's currently an attempt to formalize a subset of C, with an axiomatic semantics, all the way from specification down to machine language: http://vst.cs.princeton.edu/

Re:Report: NSA spied on Brazilian, Mexican presidents on Monday September 02, 2013 @11:37AM (#6315620)
I think Vidarh's point is that the US has a long history of manipulating and overthrowing democratically elected governments, a practice certainly made easier when the CIA or NSA have access to the complete communications of the politicians (or candidates). That's certainly an 'existential threat to democracy', just not the one you vote in (with some nominal power to exercise 'oversight' over such agencies).
Out of curiosity, what's wrong with Unison?
Re:Obama: No warrantless wiretaps if you elect me (2008) on Friday June 07, 2013 @01:03PM (#5840083)
I was involved in marking a standardized test for high school students and one question involved inventing a story on an (unspecified) election. What shocked me the most, aside from the poor writing ability, the unintentionally unbelievable facts of the stories, and the surprising amount of confusion and internal contradiction within the students' responses, was that although remarkably few students demonstrated much awareness of politics or the political process, despite having taken a mandatory course on this subject, nearly all of the students regarded voting as a mystical or near-spiritual experience of civic involvement, social communion, and individual empowerment.

Some students were probably 'sucking up'. But nearly every student?

Google didn't exactly invent the self-driving car - they basically bought the Stanford team and some people from CMU and elsewhere.
Re:Modern Physics From Scratch on Tuesday May 14, 2013 @02:50PM (#5707125)
It's funny you mention these two books in the same comment, since I always assumed Landau was one of the targets of Sussman and Wisdom's comment, "It is surprisingly easy to get the right answer with unclear and informal symbol manipulation." (See their paper, Functional differential geometry.) Sussman/Wisdom's book is, from a brief look, not 'rigorous' either, but the 'symbol manipulations' in Landau/Lifschitz's series are sometimes borderline insane!
Re:Why SICP Matters on Tuesday April 30, 2013 @12:12PM (#5633049)
The soon-to-be-released GHC 7.8 (Haskell) can defer type errors until runtime to allow you run your program even if part of it is broken, and you can also add "holes" in place of an arbitrary expression and the compiler will tell you the type of the expression you need to replace it with (of course, this will explode if run). I suspect GHC's error messages are better than Ocaml's as well.
Re:How would you teach a middle / high schooler how to code? on Saturday February 02, 2013 @03:09PM (#5157142)
> I'd concentrate first on building internally consistent mental models.

I strongly agree -- and the Lisp/REPL combination is extremely helpful. Specifically, I believe a Scheme-based approach is the best way to learn programming, even if you eventually decide to migrate to something less fortunate like Javascript or Python ... in under an hour from your first exposure you can be thinking about stuff rather than the syntax of loops. I won't attempt to justify the pedagogical reasons for this choice here.

Specifically, I'd recommend (1) using Racket, a "batteries-included" Scheme derivative with a simple IDE/debugger, and either (2) Concrete Abstractions (free at https://gustavus.edu/+max/concrete-abstractions-annotated-to...), or (3) the upcoming book Realm of Racket (coming in May), which will cover some of the same CS 101 material as well as GUI and distributed programming via writing games in Racket. (There is an earlier book called Land of Lisp but I feel its environment (CLISP) and coding practices are rather baroque.)

Depending on your student's interests you could simultaneously look at some web programming (plenty of HTML/CSS material is available from Mozilla, Google, etc.; there's an upcoming Udacity course on HTML5 game programming), lower-level stuff like assembly, arduino, or whatever.

Hope this helps.

A number of relevant disclosures are listed at http://www.salon.com/2010/12/24/wikileaks_23/ .

I don't know how one could argue that, e.g., releasing cables showing the Afghanistan war is "unwinnable" (a la Daniel Ellsberg), showing the deep hypocrisy and corruption of many governments (e.g., the Saudi rulership), and the bullying of all sorts of governments into falling in line with American military and economic interests isn't a "good".

If there haven't been any visible policy changes by the US government, then perhaps it's because such a change is not easily to connect directly to Wikileaks. Of course, it could be that Robert Gates is correct in saying claiming that consequences for US foreign policy (from the leaked diplomatic cables) have been "modest". If true, that is unfortunate, but surely not the fault of Wikileaks?

Re:New 25 GPU Monster Devours Passwords In Seconds on Wednesday December 05, 2012 @04:35AM (#4875579)
Roughly speaking, CPUs are highly optimized for sequential execution, with long pipelines, high power consumption, and complex implementations of arithmetic/logic instructions (I'm not an expert, but I _believe_ these are much _better_ than on GPUs, except possibly for certain graphics-related GPU primitives), but relatively few threads. GPUs are optimized for parallel execution, and run many more threads than CPUs, each with higher latency, but nonetheless with higher overall throughput.
Re:How I Gamified the Google Interview on Friday November 30, 2012 @10:06PM (#4856681)
Yet Google still has a reputation for very selective hiring ... is that because most of the hiring decision isn't interview-related (degree/GPA/projects/resume)? Or is it that, while the data structures/algorithms questions might not be too hard, it's possible that the interviews are still difficult, due perhaps to a degree of randomness, or to high standards (candidate is IO-bound not compute-bound, never makes a mistake, uses of axiomatic semantics to prove correctness as she writes...)?
Re:VLC Core is LGPL on Thursday November 15, 2012 @12:36PM (#4789682)
The idea of a nation-state considering itself bound by the GPL is absurd.

Only users can keep themselves safe -- developers can't.

Re:Why Erlang matters on Tuesday November 13, 2012 @09:37PM (#4781759)
Until recently, Haskell didn't have an equivalent to Erlang's built-in support for distributed computing, but the new Cloud Haskell library (http://www.haskell.org/haskellwiki/Cloud_Haskell) provides message-passing concurrency with a semantics very close to that of Erlang (but with more support for type-safety).

I'm not sure Cloud Haskell is ready to dethrone Erlang (and the OTP framework, and tooling for debugging distributed processes, and special VM features, ...) for high-reliability distributed computing today, but Haskell and its libraries are evolving with absurd speed and the Cloud Haskell ecosystem could certainly be competitive with Erlang in the near future. Haskell can certainly be used to write high-performance network applications (e.g., Mighttpd, Warp), so it's surely only a matter of time ...

Re:Think Bayes - Bayesian Statistics Made Simple on Wednesday October 10, 2012 @01:15PM (#4637259)
Unfortunately, it's only the first 95 pages.
> Is there a language, like Latin, that can help form the basis for understanding other languages and make learning easier?

As inetsee says, Scheme is this. It will provide you with a firm basis for actually understanding how programs execute. (Theoretically, learning C will also do this, but if you want to come from that direction I recommend learning some assembly language instead, since the semantics of C are surprisingly complex). Stretching the analogy rather dangerously, Scheme is as relevant to the past, present and future of other languages as Latin (though this is a conceptual rather than historical truth), as pedagogical/minimalist as Esperanto, and as expressive as English.

Also, if you find HtDP too tame or SICP too challenging (certainly possible unless you have a science/math background, though most parts requiring specific knowledge are optional), try Concrete Abstractions (http://gustavus.edu/+max/concrete-abstractions.html).

Re:The Racket Blog: Dynamic Programming versus Memoization on Sunday August 26, 2012 @12:49PM (#4435462)
Be careful -- this doesn't fully memoize recursive functions unless you force the computation of intermediate results, since the recursive calls don't use memoization:

(define memo-fib (memoize fib)) ;; example from SICP (memo-fib 40) ;; long wait

I would love to see a good general-purpose 'memoize but rather doubt it's possible, though I think I remember seeing one in Common Lisp in "Paradigms of Artificial Intelligence Programming" that exploited CL's weird namespacing rules for functions to make recursive functions like 'fib run fast.

Re:Daphne Koller of Stanford AI Lab on online education on Tuesday December 06, 2011 @12:56PM (#3320138)
I see what you're saying about the quiz questions every few minutes.

On the other hand, she's not arguing for limiting ourselves to video lectures. Her point (see page 2) is that class time is precious and shouldn't be wasted on lecturing but on problem solving, critical thinking, and discussion, and this I totally agree with. (Why is it taking institutions so long to figure this out?)

Re:Paul Dirac: The unsung genius on Sunday November 13, 2011 @03:57PM (#3231810)
I assume the article is referring to Fermi-Dirac statistics [1], not the Dirac equation.

That said, the Dirac equation (or relativistic QM more generally) as well as the Feynman path integral (the idea of which originated from a 1933 paper of Dirac) are pretty indispensable in modern condensed matter physics.

[1] https://secure.wikimedia.org/wikipedia/en/wiki/Fermi%E2%80%9...

Older »