HNHacker News
TopNewBestAskShowJobs

anon_d

256 karma · joined June 28, 2010

submissionscomments
anon_d··on Ask HN: Why isn't C# recommended more often?
Are you serious? 3 to 4 minutes is a lifetime.
anon_d··on Poll: Which 3 languages would you learn
C, Standard ML, and Unix shell.

Lojban, Swedish, and Japanese.

anon_d··on Objects vs closures

    (define (error . args) #f)
    (define (class x y z)
     (lambda (d)
      (case d ('x x) ('y y) ('z z) (else (error "Invalid slot ~a" d)))))

    (define obj (class 'this 'is-a 'test))
    (display (obj (read)))
    (newline)
The Stalin scheme compiler, if I read the output correctly, makes a separate type for 'x, 'y, and 'z. Then it does the dispatch using a switch statement (in the c code) over the three symbol types. This seems quite resonable to me; The C compiler will probably produce a jump table.

Note that I was unable to get the compiler to produce dispatch code at all without dispatching on the result of READ.

anon_d··on Ghosts of Unix Past
GUI (which you can't easily replace, since it too is exposed to the filesystem)

What? The graphics system is quite nice, there's no reason to replace that. I'm pretty sure there is nothing tying the graphics protocol to their GUI paradigm. I think it would be entirely possible to implement, say, GTK over it.

Vim

There's no reason it couldn't be ported. I would use it if you made it. It would be nice to have a libdraw based vi, even just in plan9port.

anon_d··on CL or Scheme?
I use Chicken Scheme. I prefer Scheme over Common Lisp for practical reasons. None of the Common Lisp implementations that I'm aware of can compile code to nice, small, executables that start fast and don't use a ton of memory. They all either produce a huge image file or generate bytecode that has to be run in a VM.
anon_d··on C++ Hating
A long and mostly incoherent rant. I'm ever so sick of seeing these.
anon_d··on Reddit’s Astonishing Altruism
Stop reading r/politics!
anon_d··on Lisp has too many parentheses...
It's not a problem at all, there is zero readability cost to all of those parens. Nobody with any experience coding lisp has any trouble reading it. Personally, I find lisp code to be considerably easier to read than other languages that I otherwise prefer.
anon_d··on Lisp has too many parentheses...
http://srfi.schemers.org/srfi-49/srfi-49.html

I think it's a terrible idea, but there you go.

anon_d··on Reverse.jar
With only three times as much memory, it runs on average 17% slower than explicit memory management. However, with only twice as much memory, garbage collection degrades performance by nearly 70%. When physical memory is scarce, paging causes garbage collection to run an order of magnitude slower than explicit memory management.

I don't see how this article is helping your point; that's a pretty massive hit. Even worse, this is a GC-style program modified to use explicit malloc/free. Programming with manual memory management encourages a very different style of programming where you try to use malloc/free as little as possible, and you try keep memory for various things in contiguous chunks of memory.

EDIT:

This comment is interesting: http://lambda-the-ultimate.org/node/2552#comment-38915

anon_d··on A statically typed language I'd actually want to use
[...] where the impure side of things was as easy to write as the pure computations, that would be great.

From your post, I'm going to assume that you haven't used the languages I'm talking about; sorry if I misread that. SML/Ocaml/F# are not purely functional languages, so side effects work just like you'd expect coming from C/Python/etc. The language encourages functional programming (for example, variables are immutable by default), but imperative code is far from difficult to write. I highly recommend you try one of these languages. They may just be what your looking for.

anon_d··on A statically typed language I'd actually want to use
While AliceML is quite nice, the main advantage that SML has over the other major ML-family languages is, IMHO, that it's simple, well-defined, and has several fairly-compatible and high quality implementations.
anon_d··on A statically typed language I'd actually want to use
SML/Ocaml:

- Rapid development

- Clean syntax

- Static type system

- Good performance

- Practical, not about pushing boundaries

SML especially, is a very stable, simple, and well thought out language.

anon_d··on So, why Plan 9?
Project thesis

Unfortunately, I've already done my senior project. Though, I'd be happy to hack on Glendix stuff in my free time.

/net

I've not done any network or kernel programming, and I'm only slightly familiar with /net. If I wanted to hack on this, where would you recommend I start?

It seems like a Glendix /net could be implemented in user space. Yes?

anon_d··on Oct. 14, 1985: C++ Adds to Programming
Sometimes, it is more important to have the right problem than the best solution.

Perhaps unwittingly, this statement fits C++ perfectly. It's popular to criticize C++'s design, and this is why. It's the best solution to the wrong problem.

anon_d··on So, why Plan 9?
I'm finishing my bachelors next spring, and I would kill to work on Glendix or Plan 9. Suggestions?
anon_d··on So, why Plan 9?
How did you have time to work on it when you were a grad student?
anon_d··on Why not tar? Limitations of the tar file format
> Because tar does not support encryption/compression on the inside of archives.

Yes it does? Just encrypt/compress all the files before tarring.

> Not indexed

The reason tar doesn't have an index is so that tarballs can be concatenated. Also IIRC, you only have to jump through the headers for all files. Still O(n) where n is the number of files, but you don't have to scan through all of the data.

anon_d··on What is the reason Lisp code is not written with closing parens on new lines?
> Somebody once said (anybody have the quote?) that C and java code looks blocky, while lisp code looks more fluid.

This is from Paul Graham's book, On Lisp.

anon_d··on Zsh: The last shell you’ll ever need
tl;dr:

Introduction

  zsh is UNIX shell.
So what’s zsh and why would I want it over my current shell?

  It's more bloated than just about every other shell!  Bash isn't nearly
  bloated enough!  Feature, features, features!
Ok, You Convinced Me. How Do I Start Using zsh?

  Of course I did!  One catch though:  You need a big config file to get
  access to all that bloat.
anon_d··on The classic Unix horror story
> Writing this comment, I had to look up the order of the parameters to tar; I still can't remember. Stupid tar

    ; tar c *.cpp *.h >something.tar
    ; tar c dir | gzip >something-else.tgz
Problem solved! Also:

    ; tar c dir | gzip | nc -q0 -lp 4000 &
    ; [another computer]
    ; nc $otherhost 4000 | gnuzip | tar x
anon_d··on I don't like Python. Does that make me a bad person?
What do you have against bourne shell scripting? I thinks it's probably the most under-rated language/programming paradigm I know. I really don't understand all the hate. Also, what didn't you like about Tcl? I find it much more in-line with the C world-view than python is; It's C-interface is a lot cleaner than Pythons as well.

My language-choice algorithm is:

sh + unix DSLs -> Tcl/Tcl+C -> SML/Haskell/Scheme -> C -> *

Where '*' is whatever language has a library I need, or a language that I'm required to use.

anon_d··on I don't like Python. Does that make me a bad person?
Your code sample isn't quite right.

[read stdin] returns a string (not a list of strings), which is parsed as a list when you try to loop over it. The parsing breaks the string into a list of words, so the second loop is redundant. The parsing could fail if the input file isn't valid list syntax (unmatching {}'s). [split _] makes it safe.

    foreach word [split [read stdin]] {
        if [string match *ing $word] { puts $word }}
I love Tcl too! Tcl is a scripting language for C, Python is less-powerful version of Lisp.
← PreviousPage 5 of 5