News for hackers. Stuff that matters.

helloTree

Re:Urbit: The Internet failed (slides and video) on Tuesday October 01, 2013 @12:59AM (#6474161)
thanks!
Re:RegEx101.com now offers a debugger on Monday September 30, 2013 @02:03PM (#6471162)
You are absolutely right, I forgot the '.'.
Re:RegEx101.com now offers a debugger on Monday September 30, 2013 @02:00PM (#6471140)
Ok then maybe it's just a matter of taste. I like the parser approach more:

import Text.ParserCombinators.ReadP -- or the parser lib of your choice

import Data.Char

...

macP = count 16 (satisfy isHexDigit)

Re:Clojure's core.typed vs Haskell on Monday September 30, 2013 @01:47PM (#6471030)
This is the same for Haskell where it's also convenient to develop in the repl (ghci).
Re:RegEx101.com now offers a debugger on Saturday September 28, 2013 @06:30PM (#6463372)
What is it with the obsession with regular expressions? They are useful things, sure, but I just use them in connection with grep or if I search for strings and normally they are pretty basic, e.g.

$ grep -r -n --color "foo*bar" src

If I want to validate input data with the machine I just use a parser.

Re:Urbit: The Internet failed (slides and video) on Saturday September 28, 2013 @05:20AM (#6461396)
You are talking about halvm I think - is it still in use or is it a dead project? The github project page does not seem to have seen commits for a while, but maybe it just ... works.

And can you please point me to the talk?

Re:Show HN: Solid, a scripting language with a tiny VM on Sunday September 22, 2013 @06:07PM (#6428259)
Just wanted to say, kudos! I think it is essential for a language to have a good C interface otherwise it will be insulated. However some more example would be nice. Furthermore I think you mean "infix" in your documentation and not "inline".
Re:Vim: from n00b to meh on Sunday September 22, 2013 @04:42AM (#6426253)
... and one should always remap ESC. For me this was a big improvement (from an ergonomic viewpoint). My suggestion:

imap jf <ESC>

Re:Command-line tools for data science on Thursday September 19, 2013 @08:48PM (#6415321)
Maybe I should take a look at awk/sed but I never found its language orthogonal. For simple scripts I mostly use Python or Haskell via something like

ghc -e 'interact ((++"\n") . show . length . lines)' < file

EDIT:

I know that it's the same like "wc -l" but using that approach I can solve also problems that may not be well suited for awk/sed. Or maybe I just have to see some convincing one-liners.

There is also a fun part in the documentation of xorg.conf, just do

$ man xorg.conf

and search for "nobody"

;)

Re:Humble Indie Bundle 9 released on Wednesday September 11, 2013 @03:06PM (#6369232)
If you are interested in chilled thoughtful gaming and have a faible for SciFi ala Star-Trek and Co. you MUST try FTL. It is one of the best games I have ever played and I do not know another game that is similar. It is easy to learn and hard to master and although it is Single-Player it has an immense replay potential.
Re:Unix Commands I Wish I’d Discovered Years Earlier on Wednesday September 11, 2013 @03:52AM (#6366034)
Yeah it is great if you can use similar commands across applications. Btw. there is also a nice history inside VIM (implemented as a separate buffer) that can be accessed using q: so you can scroll through the history with jfkl. E.g. I use that for accessing files: If you are working on a project you will probably edit similar files. If you use one "programming" vim sessions where you always edit files via :tabe you will find all the recent edited files in your history and using q:/ you can search for them pretty fast. So over time you have automatically a working environment adapted to your current project.
Re:Unix Commands I Wish I’d Discovered Years Earlier on Tuesday September 10, 2013 @07:09PM (#6364224)
My biggest improvement was about finding out about .inputrc and configuring the Bash to use VIM-keybindings which is pretty handy if you are used to the editor. Also the following mapping from ESC to pressing jf via

imap jf <ESC>

was very nice as I find it much more ergonomic. And to use it in Bash I have

set editing-mode vi set keymap vi

$if mode=vi set keymap vi-insert "jf": vi-movement-mode $endif

set show-all-if-ambiguous on

Re:Quark: A secure Web Browser with a Formally Verified Kernel on Sunday September 08, 2013 @10:05AM (#6348714)
How does this work, if the kernel is supposed to be TM-complete?
Re:Libre News, political discussion powered by Arc Lang on Tuesday September 03, 2013 @05:00PM (#6323708)
But probably you get stuck in local maxima. E.g. if I am on Hacker News I want to find new and exciting stuff and not things I already know ...
Re:Square open-sources its Vim repo, Maximum Awesome on Thursday August 29, 2013 @07:57PM (#6299385)
Can you elaborate on this? I also use XMonad in connections with a simple xterm (although I used screen some years ago, but then I did not know about XMonad) but I do not get the idea of detaching/reattaching. Is the idea to save the state of the session?
Re:Nginx Plus on Thursday August 22, 2013 @04:28AM (#6255873)
Yeah, I can feel with them and it IS hard to make money with FOSS software. I think the problem is that the argument "You can sell support and consultancy to your software." is a little bit flawed as it contradicts with one fundamental purpose of software development: automating things;

So things should just work and if you are able to build a software that is easy to install, start and configure the user has no demand for support.

Re:Don't reinvent the scrollbar on Tuesday August 20, 2013 @06:14PM (#6246953)
Omg, some people have strange problems ... If you want to know how far you are you just look where the scroll bar is now, scroll down until the end (or comments) sections and then you can estimate how far that is.

I do it that way and I have seen many people who do it the same. However I agree, that pages are bullshit in a web context.

Because (static) FP is built on a sound and rich theory (type theory and lambda calculus) unless other language paradigms (e.g. OO). There are also different approaches, IMHO:

FPL research: Ok, we have this cool way to describe our computation. But how can we efficiently map this to the HW? In essence build a nice language and find an implementation.

Imperative PL research: Ok, we have this HW, how can we build an expressive PL on top of it? In essence build an implementation (the HW) and find a language.

Re:Why functional programming? Why Haskell? on Saturday August 10, 2013 @07:09AM (#6190677)
Do you know of any major prolog programs that are in use and where you think that they really are successful because of prolog's strengths? I did a little bit of prolog in a logic course, but it never felt natural to me compared to functionl programming. But of course, maybe that's just because I did not dive into it and there are people who think FP feels unnatural. However I really would like to see some real world software in it (with "real world" I mean no AI system, planning system or inference system, but something very small, e.g. a web server, a text editor, a graphics engine, a synthesizer, an operating system, etc.)
I am not sure such glasses will take off. You have always a fucking HUD before your eyes and I am not sure everybody likes that (I never tried it but I even do not like normal glasses and prefer contact lenses as I feel more free that way).

I would appreciate something like a small beamer a lot more where you can project a UI on a suitable surface (holograms seem to take longer ;) and control it either by a pointing device or gesture control.

Re:Why is cycling so popular in the Netherlands? on Thursday August 08, 2013 @11:41AM (#6179597)
I live in Austria and cycling is very popular here. E.g. I use my bike everyday often multiple times it's the preferred transportation unit and I do not have to own a car and can reach every part of the city and all the things I need in 30m.

There is just no need for a car here. If I want to get further away I can use an excellent (although, admittedly rather expensive) public transport system.

Re:Awk in Haskell on Wednesday August 07, 2013 @09:34AM (#6172691)
Or just use ghc -e, e.g. some useful scripts

for interact:

#!/bin/bash ghc -e "interact ($1)"

line processing:

#!/bin/bash ghc -e "interact (unlines . map ($1) . lines)"

Re:Haskell vs. C on Tuesday August 06, 2013 @03:57PM (#6168773)
I think it would be nice if there will be a world where you can express such a problem in a decidable mini-language where the compiler can deduce that the answer will be n(n+1)/2. :)
Re:Digital physics on Tuesday August 06, 2013 @08:23AM (#6166137)
As a computer scientist I like the idea as I also believe that information (and time or a unifying concept of them) is one of the most fundamental building blocks of the universe, however we have to keep in mind that we leave the territory of science here. The statement: "The universe is just a simulation." is just not a scientific theory as this is probably unfalsifiable [0] or am i wrong?

[0] http://en.wikipedia.org/wiki/Falsifiability

Re:Ask HN: Share your top 10 linux commands on Friday July 26, 2013 @06:02AM (#6107398)
Looks like you use nano for Haskell development and vim for the other stuff why's that? And a minor tip, you can close your tty using ^D (because I saw exit).
Re:Bill Gates on the future of education and programming on Saturday July 20, 2013 @02:25PM (#6076031)
This.

This is also an argument against doing a PhD where you are expected to focus on a very narrow field. The problem is that we want to measure academic progress by numbers in form of papers so scientists need to publish a lot otherwise they run out of funding. But if there is always this pressure to publish there is less time to step back to see the big picture.

Re:Building a Modern Computer from First Principles on Sunday June 16, 2013 @07:23PM (#5890499)
My point is that after reading the book I kind of knew how I could implement a simple CPU in real HW (with ALU, memory, etc.) but it was not clear to me how the IO part (kbd, screen) would work. Is the kbd connected directly to a certain place of memory? How is this implemented? Would there be some screen/gpu HW that is directly connected to the memory region? How is the CPU clock involved?

E.g. if you press a key, hold it and then release it, it is possible that this event gets missed as it was too short and the key press method did not check the memory region at the right point of time. For me their implementation enforces this bogus "I am in total control of everything that happens feeling" which often leads to bad design as it ignores the messy real world. I would have appreciated something more sophisticated and generic there which would work for different kinds of HW. Maybe I am missing some simple bus-system one might say ...

Nevertheless it is a wonderful book and I had lots of fun with it! :)

Re:Building a Modern Computer from First Principles on Sunday June 16, 2013 @03:40PM (#5889609)
It's an amazing book and doing all the projects is really fun. However keep in mind that the computer you build is really simple and in my opinion maybe a little bit too simple. In particular there is no decent IO model and reading from the keyboard is simply done by busy waiting and writing to the screen is done by writing to a special region in memory. This is ok, as the book covers many topics, but I would enjoy finding a book that covers this topic in detail. E.g. the famous patterson-hennessy book about MIPS covers the implementation of a RISC processor in great detail but does not go into detail about IO stuff which is in my opinion the really hard part.

Older »