Hacker News new | comments | show | ask | jobs | submit login
Hauberk – A web-based roguelike written in Dart (github.com)
165 points by tosh 10 days ago | hide | past | web | 32 comments | favorite

This is neat! The author also wrote Game Programming Patterns and the Dart code formatter:

http://gameprogrammingpatterns.com/ https://news.ycombinator.com/item?id=10195091

And he wrote a really nice article about the maze generation algorithm that he uses in Hauberk: http://journal.stuffwithstuff.com/2014/12/21/rooms-and-mazes...

It has inspired me to build my own dungeon crawler, and I have reused a lot of his ideas from the article.

He really is munificent!

He is also writing a book on building interpreters: http://www.craftinginterpreters.com/


In the recent stack overflow developers survey, Dart was actually ranked as one of the least liked languages to use. This has actually put me off the language a little bit.

I'm curious if anyone with more experience with the languange could explain why this is and what it means.

My guess is that most of the people who said they dislike dart probably never used the language, but still have this opinion because of the whole brouhaha when dart first introduced with the possibility of replacing Javascript in Chrome.

Now that dart is also evolved into something else (A nice language that compiles to Javascript and runs on its VM for mobile devices) I wish that this bad blood goes away and people could take a fresh look. I really like the language and appreciate the hard work of developers of Dart ecosystem.

> I wish that this bad blood goes away and people could take a fresh look




RPM Based Distros

You name it and people have opinions based off of rumors.

Interesting. Sounds like a rebranding may be necessary.

No, developers just need to stop being sheep and start evaluating technology for what it is.

If the world is not the way you want, you can either get frustrated about it or adapt.

disclaimer: ex-Googler, on-and-off developing in Dart in the past 5 years (mostly on).

I had a choice last year where I could have chosen any stack for a new independent product. I've done an exhaustive research, did everything to detox myself from the Google cool-aid, got myself up-to-date with other languages and platforms, did my benchmarking and comparison using real code for the product I was to develop. In the end I've selected Dart for several reasons:

I can start coding using only a few types, and as the code gets its final shape, strengthen it with type annotations and turn on strong mode. This is an interesting productivity boost, because I can draft a quick script if needed, and when it becomes more complex, the toolchain is there to refactor and make more structure around it. People migrating from JS to TypeScript advocate the same process, only Dart is much better in both refactoring, and long-term safety (see the bad parts of JS).

I like the Dart VM. It is not as robust and fast as the Java VM, but close enough, and it is much faster than V8 (Node.js), Python or Ruby. Of course your results may vary on your benchmark, but for my workload it was a perfect match. One benefit compared to the JVM was that I didn't need to specify the max heap memory in DartVM, the program scaled up using 12G easily and almost effortlessly in a single isolate (which is a fine plus if you have several server processes, and need this boost only for a couple of minutes per day). Haven't tried larger heap sizes, but for a single-isolate memory use this was OK for me.

Readability is important. I've several examples where people were able to get quickly productive using Dart without former experience in it. I've applied for jobs (and got offers) using Dart as the interview language, and even though the companies were not using it, the interviewers were always able to get what I'm up to. A friend's company will soon train their HRs/recruiters in Dart, because they want to shorten the hiring process.

I could go on, but in short: it is a language and platform which, at least for me, combines the benefits of Java, Erlang, Python and JavaScript, while keeping it sane and useful.

I think you should evaluate any language and platform for your needs, and rely less on internet popularity scores.

> I think you should evaluate any language and platform for your needs, and rely less on internet popularity scores.

A solid advice, but not very practical in this age when there's too many language-framework combinations to take them all for a spin. We just have to rely on other people's opinions and surveys. Your summary of Dart strengths is valuable in that sense.

Built our system with Dart on front and backend, and we LOVE it. Powerful language, no surprises, easy to learn. You will indeed find lots of hate for Dart all over the internet. I would highly encourage you to ignore it and explore it. Two knocks against it are the package ecosystem isn't as comprehensive as other langs, and the language itself has not been evolving much at all. There is ongoing work on an intermediate representation to facilitate the last point: https://github.com/dart-lang/sdk/tree/master/pkg/kernel

If people hate a language, my rule of thumb is, the more viciously they hate it, the more interested I get. Even if it's just to find out why people hate it, and maybe I'll find something interesting.

(And even if I find it as bad as everbody says it is, I can still pour some condescension over it and feel good about myself - Either way, I win!)

So do you dig deep into Java, Fortran, Cobol, etc?

I did not dig very deep, but I completed a tutorial in all of these. Cobol was not a pleasant experience, I did the Hello World and moved on.

Fortran did not click for me, but I gave it a fair (I think) try, and compared to its abysmal reputation, it was actually fairly nice. At least for the couple of toy programs I wrote in it. Fortran 90 or 95 was a significant improvement on previous versions, as far as I could figure out. But I had no use for it either, so I moved on.

I had to learn Java during my training, around the time I had finally understood the basics of functional programming and Lisp, so I hated Java with fierce passion. ;-)

Sometime after that I took another look at Java and now it wasn't as bad - Generics had been introduced to Java, and I finally had a computer powerful enough to run something like NetBeans or Eclipse. But you know what they say about first impressions. ;-) I don't hate Java, but I am not drawn to it, either.

Sometimes, the experience is very ambiguous, for example with C++. Some people love C++, and I think I can see why they love it. Some people hate C++ passionately, and I can see why they hate it, too. It's weird. (But then, so is C++)

I checked it out although admittedly only very briefly. My impression of it was that I couldn't really complain about the language, library, or docs. It felt like a language that abstracted away all the details about HTML5+JS and turned Javascript and DOM into higher level constructs.

I think that is both its blessing and its curse, because it distances you from what you are actually working with. Convenient, sure, but now there's a disconnect, and you will inevitably work with other Javascript code, so that this disconnect will then affect you.

I think TypeScript had the better idea here and ultimately what might have largely stopped Dart in its tracks. TypeScript being a superset of Javascript makes it easy to progressively port your apps to an often more sane, safe, and productive language, while still not creating a disconnect on the level of Dart. It even has a solution for third party JS code out of your control via type definitions.

Their AdSense is written in Dart Angular, so I guess it is not so unpleasant to use. It just did not get hype as TS did 1 year ago.

Dart and AdSense are both Google teams.

To get promoted at Google, you need to demonstrate project complexity so engineers is required to build new frameworks. Is it quite risky to adopt an AdWords framework (like GWT) which has high chance of being deprecated?

I believe as long as a technology is truly open source, you can fork, build and use it independently, your risk is minimal - be it Dart or any of its alternatives. Worst case: you have a stack that can operate for several years, long enough time for a business product to get migrated. If it is hobby project, you may be compelled to explore a new tech stack soon enough anyway.

As I mentioned in my longer post, I have considered alternatives. Dart's position was strengthened because the code analyzer is very advanced and easy to use. On the low-probability scenario where Dart development would cease, and I'm left with an important Dart codebase, I would have good chances that I could automatically transpile most of my app to a new stack (assuming I'm using enough type annotations).

However, as I follow Dart development and community closely, I believe there is very little risk of getting it abandoned anytime soon.

I wonder what deranged form of loss-aversion is driving google's decision to make dart their preferred UI language for their upcoming OS fuchsia.. hopefully I'm just ill-informed and everything is fine.

If they get to build an efficient OS with a language running on a virtual machine and without pointers, they would have made a point. Only the future will tell.

Do you program with Dart? Any experience with Flutter?

Google put up a code lab for Flutter:


It's a super simple UI but you can just pretend it's Java and read through the code samples to get a feel for how things are structured/organized. As a web dev with a strong preference for functional programming I find it unpleasant but I don't think I'm the target audience.

It looks well done as far as the "graphics" goes.

My last roguelike was nethack and probably the genre improved on it and things changed. Example: I was surprised, and not pleasantly, that this game doesn't use the same keybindings of the rogue/nethack tradition. I had to read the docs to learn how to pick up things. It turned out it's "g" (lowercase and not uppercase as in the doc). I didn't find how to rest: "." didn't work but I confess I didn't spent much time on it.

If you want a taste of an up to date roguelike, you can try Dungeon Crawl Stone soup.

You can also play online at https://crawl.develz.org/. It uses the Nethack keybinding for the most part, and you can get access to help in game by typing '?'.

> I was surprised, and not pleasantly, that this game doesn't use the same keybindings of the rogue/nethack tradition.

Strangely enough, this was one of my initial motivations for starting to hack on my own roguelike about twenty years ago.

I learned to play MacMoria and later Angband using the numeric keypad and never learned the Rogue keybindings. When I got my first laptop and it didn't have a full numeric keypad, it wasn't so easy to play Angband anymore. So I just started tinkering with my own game instead.

Yes, the keybindings for Hauberk are idiosyncratic (and not at all documented). I do like them, though. I've tried to make them ergonomic, at least for a user of a US English laptop keyboard.

L for rest (lower-case for a single turn stood still, with shift to rest until health recovered), or the 5 in the middle of the numeric keypad if you have the right keyboard layout, I guess. Sadly 5/the numeric keypad diagonals don't work on my UK keyboard layout.

There are some alternative keys but I keep mixing them up with (the more traditionally roguelike) vim keys, which they are near but not quite similar enough to.

Looks really beautiful though! Enjoying bashing my way round; I don't know Dart but I'm looking forward to taking a peek at the source later.

(My favourite actively updated roguelike is Dungeon Crawl: Stone Soup. There's a new version due next week...)

I've enjoyed both Brogue and Dungeon Crawl Stone Soup

Was pleasantly surprised when I recognised his avatar as being on the back of his book on my shelf

I'm staring down at you from your bookcase!

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact