

Take Over The Galaxy with GitHub (DCPU16 support) - rlm
https://github.com/blog/1098-take-over-the-galaxy-with-github

======
phren0logy
I'm having a hard time articulating why I think this is so fantastic. It's
great to see people attack a not-so-serious problem with such gusto. I love
the passion behind taking things apart just to see how things work.

Thanks, github. You made my day.

~~~
dan00
The value of just playing around is underestimated. A lot of discoveries have
been made by people just playing around.

~~~
cdk
As someone with not a lot of experience in low level languages and I can't
wait to play around with this. I think it will be fun way to learn and maybe
even try building hardware implementation using a FPGA.

~~~
dholowiski
Hackaday.com will be running a competition for hardware implementations:
[http://hackaday.com/2012/04/08/getting-12-year-olds-to-
learn...](http://hackaday.com/2012/04/08/getting-12-year-olds-to-learn-
assembly-programming/)

~~~
DanBC
The comments link to information about the Apollo Guidance Computer.

(<https://en.wikipedia.org/wiki/Apollo_Guidance_Computer>)

(<http://www.ibiblio.org/apollo/>)

------
gravitronic
Ok after seeing the assemblers/VM's last week I wasn't expecting to see much
new this week.. then I saw this:

<https://github.com/krasin/llvm-dcpu16/>

C compiler support for dcpu16!

In a way this almost saddens me as by the time the game comes out it looks
like the community will have javascript ported to the CPU and no one will
actually have to program in assembler as per the original idea... ;)

~~~
TazeTSchnitzel
It _could_ run JavaScript, but this is a 16-bit processor we're talking about
here, with minimal RAM. It's more likely we'll be using C and BASIC ;)

~~~
flatline
Yeah this seems like the exact scenario where hand-rolled assembly and perhaps
some hand-optimized C will really shine. You don't see a lot of embedded
processors running javascript, for example. If your ship can process data and
respond 5% faster than an opponent's, all other things being equal, you will
come out ahead.

If the current level of interest persists, by the time the game launches, I
imagine that the vast majority of people will be downloading and running
programs written by others. These will have been pored over and optimized to
an extent that most of us would be unable to achieve by ourselves, and it will
not pay to roll your own trivial implementation. I'd be curious to see what
Notch can do to still encourage people to learn how the CPU works themselves.
If the environment and game dynamics are rich enough, perhaps this will not
really be a problem?

~~~
dons
I think we're going to see some clever optimizing DSLs (a la FFTW) --
restricted languages for the kinds of embedded programs you write on such an
architecture will be easier to optimize than general purpose languages.
Particularly if they have a clear cost model.

The Haskell embedding is very likely to head in that direction.

(See e.g. in this style : <http://www.fftw.org/faq/section4.html#whyfast> or
this style : <http://www.cse.unsw.edu.au/~chak/papers/polymer.pdf> \-- code
generation + DSL + constraint solver for instruction level timings).

At least, that's what I'd do.

~~~
masklinn
Low-level lisps à la GOOL/GOAL[0] will probably gain some traction as well, or
so I hope.

[0] <http://en.wikipedia.org/wiki/Game_Oriented_Assembly_Lisp>

~~~
wjbr
Did they ever get released to the public?

~~~
duaneb
No, but the design docs are still out there if you contact the former
engineers. I would distribute them if I had permission.

------
MiguelHudnandez
I want to see a networking protocol between ships so that fleets form in order
to take advantage of multiple "cores."

So for example, you'd have the difference between a single-celled organism
(standalone ship) versus a multi-celled organism (a fleet), with a fleet of
ships delegating work to specific ships. So 10 ships run the "scout"
programming in a perimeter, 5 act as resource gatherers, and a few others as
transports within the protected space. Perhaps some act as brain cells which
tell ships when to change roles.

All of this is happening even when no members of the fleet are actually
playing.

This just boggles the mind with possibilities and I can't wait to start
playing this game.

Furthermore, you have people trying to break into space protected by fleets by
attacking _networking protocols_ \-- _in a game!_

------
yolesaber
I had a dream the other night wherein there was a start-up that took custom
code requests for 0x10c players on commission. Requests ranged from optimizing
the ship's defense to autopilot and hyperspace jump controls.

Viable?

~~~
xsmasher
Due diligence is called for. Has this business model been successful in other
games? Do you have some advantage over the throngs who will gladly do it for
free / recognition?

~~~
yolesaber
While I can't think of a specific example, there are related precedents:
consider the advent of the Mann Co. Store in TF2 where players purchase game
items with real cash. There is definitely a model to be made off players with
disposable income who want to be the top dog.

Your second question is a reservation that I have as well. We have already
witnessed a huge influx of people coding up DCPU-16 software for free, but
such programs are only related to the software engineering side of the spec
rather than the actual gameplay. Obviously we know less about the latter since
few details have been released, but in the competitive game I imagine it could
be different. For example, to build a really awesome weapons system and then
share it with other people seems a bit counter-intuitive. So there may be room
yet for a business built on custom, clandestine code for a player's ship.

Gamers are already a demographic with money to spend. This could be seen as a
worthwhile investment to some. If you are interested, email me and we can talk
there.

~~~
xsmasher
I phrased it as a question because I don't know the answer either. I've heard
that second life had a thriving economy of user-generated content and that
some players "make a living" from the game; I've never seen hard numbers
though.

I doubt the returns reach the proportions necessary to support a startup,
especially with the low barriers for entry, competition from free
alternatives, and piracy. Maybe it could support a single developer, though;
more of a "lifestyle business."

------
jazzychad
HN is funny. Last week as each new dcpu emulator implementation popped up,
they got fewer and fewer votes and more comments like "oh great, yet another
dcpu post. let's call this Dcpu News for crying out loud!" Then github adds
syntax highlighting and gets 150+ points. I'm very curious why that is...

~~~
Twisol
The emulators got less votes because it was more of the same exact thing
("someone implemented DCPU-16"). This is news because a big name has _taken
notice_ of DCPU-16, going so far as to officially support it. It's a different
flavor.

~~~
jazzychad
Ah, so dcpu is cool now because somebody cool says its cool. Just seems like
bandwagon/fanboyism to me. Call me a dcpu hipster :)

btw, awesome work w/ mappum on the js emulator stuff. you guys update w/
impressive speed.

~~~
Twisol
It's not fanboyism, most like "stop showing me emulators it's not interesting
anymore". The subject of the DPCU iself is still pretty interesting.

Also, thanks!

------
soupboy
Looking at all the amazing work done regarding the DCPU and the article
yesterday on Instagram's technology stack made me realize just how far we've
advanced. With the tools that we have available now, it is possible to do
things in a few days that it took people years if not decades to achieve.

~~~
unreal37
"it is now possible to do things in a few days that took people ... decades to
achieve".

Let's not get too excited here. Name one thing that can be done in days that
used to take decades.

~~~
lolcraft
The first Fortran compiler's creation took 18 person-years. Now there are C
compilers which were written from scratch in _person-weeks_ , like TCC.

~~~
mbrubeck
But the first C compilers were written four decades ago by a couple of people
in a matter of months. And they were not just writing the compilers but also
designing the language at the same time.

 _"When Steve Johnson visited the University of Waterloo on sabbatical in
1972, he brought B with him. It became popular on the Honeywell machines
there, and later spawned Eh and Zed (the Canadian answers to `what follows
B?'). When Johnson returned to Bell Labs in 1973, he was disconcerted to find
that the language whose seeds he brought to Canada had evolved back home; even
his own yacc program had been rewritten in C, by Alan Snyder."_

\-- Dennis Ritchie, who wrote the first C compiler. <http://plan9.bell-
labs.com/who/dmr/chist.html>

------
waffle_ss
Weird that they didn't include the language link[1] that shows all the repo
statistics for the language, like most watched, most forked, newly created,
etc.

[1]: <https://github.com/languages/DCPU-16%20ASM>

------
Natsu
Notch tweeted the other day that he was thinking about DCPUs coming with some
fan-made open source OS... as soon as someone writes one. This should be
interesting.

------
newobj
I wonder if Notch is regretting releasing these details so soon. Now he's
already going to be a slave to backwards compatibility and the game is about
0.1% complete.

~~~
phren0logy
Seeing that everyone is doing this just for fun, I doubt it. He could change
everything tomorrow and I bet people would be excited to do it all over again.

~~~
newobj
I don't think _everyone's_ doing it for fun, I'm sure there are savvy dudes
out there that know that there's a lot of money to be had by being a first
mover in the Notch ecosystem.

But even those that are doing it for fun -- you might be underestimating the
amount of nerd rage that people are capable of when stuff they don't want to
have happen happens. Just sayin'.

------
codesuela
now let's just wait for the first O'reilly book on DCPU16 programming

~~~
AbyCodes
no starch press most likely :D

------
iseyler
While its great the GitHub added support for this how about x86-64?

[https://github.com/ReturnInfinity/BareMetal-
OS/blob/master/o...](https://github.com/ReturnInfinity/BareMetal-
OS/blob/master/os/kernel64.asm)

The 64-bit register names are still not handled correctly. It does properly
color the 8, 16, and 32-bit register names.

~~~
roryokane
GitHub uses the open-source Pygments (<http://pygments.org/>) to highlight
source code. If you can find the code for whatever ASM highlighter Pygments
uses, you could probably fix it yourself. Though I tried searching for it and
didn't find it after a while, so it would take some tracking down.

------
petercooper
Now all we need is a DCPU16 to x86 translator and we have a whole new stack of
dev tools ;-)

------
neilparikh
I'm a beginner programmer with a little of bit of programming experience, and
this idea of programming a game through assembly interests me, but I'm not
familiar with assembly. How should I go about learning DCPU16?

------
rasur
So, who's going to be first with a hardware implementation of the DCPU16? :)

~~~
tcas
I'm working on a multicycle implementation that I will be able to push to a
FPGA. There's no way I'll be able to get the same cycle timing as the specs
indicate however. 3 cycles for a divide is very, very generous for such a
simple CPU, I'll probably either end up implementing a shift and subtract
algorithm (will take more than 3 cycles), or using huge look up tables
(probably too big fit in a single blockRAM as well...) to try and achieve it.
On the other hand, SHR and SHL are trivial to do in hardware via a barrel
shifter, but he assigned 2 cycles for them.

The [next word + register] instruction is also a bit annoying to deal with in
the given time tables and a simple register file design, though I haven't
thought about the design of that too much.

~~~
obtu
Would it be a good idea to run the instructions as fast as you can, adding
some cycle accounting and using it to generate some external interrupt to help
implement quotas? Though when it gets IO support you might have to run things
entirely in lockstep again.

------
cpeterso
What does the D in DCPU stand for? Notch's DCPU16 spec does not say.

~~~
Raphael
Digital?

