HN user

helloTree

38 karma
Posts3
Comments29
View on HN

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)

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.

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?

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".

... and one should always remap ESC. For me this was a big improvement (from an ergonomic viewpoint). My suggestion:

imap jf <ESC>

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.

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.

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.

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

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?

Nginx Plus 13 years ago

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.

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.

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.

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.

Awk in Haskell 13 years ago

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)"

Haskell vs. C 13 years ago

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. :)

Digital physics 13 years ago

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

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.

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! :)

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.