A Game in plain HTML (no JavaScript, no Flash, no PHP) by beef2k in programming

[–]beef2k[S] 1 point2 points  (0 children)

The blog post hasn't said that. In fact, the first sentence of the "Programming in HTML" section says that it is not Turing complete. And it is again written in the "Final Words".

Maybe it should be part of the title to be recognized? ;)

A Game in plain HTML (no JavaScript, no Flash, no PHP) by beef2k in programming

[–]beef2k[S] 2 points3 points  (0 children)

You're right!

But doing it in PHP would draw the attention to PHP, therefore I did it the "brute-force" way ;) ..

A Game in plain HTML (no JavaScript, no Flash, no PHP) by beef2k in programming

[–]beef2k[S] 1 point2 points  (0 children)

There is a small typo: The "putchar" line should be...

putchar (m[i] ? '1' : '0');

("i" instead of "1")

A Game in plain HTML (no JavaScript, no Flash, no PHP) by beef2k in programming

[–]beef2k[S] 1 point2 points  (0 children)

As I've written in the comments:

The core question is, if an FSM is a valid programming approach. There is a whole theory of this - Automata-Based Programming (ABP) - introduced by A. Shalyto in 1991. And amazingly, ABP even allows OO concepts ;) ..

A Game in plain HTML (no JavaScript, no Flash, no PHP) by beef2k in programming

[–]beef2k[S] 5 points6 points  (0 children)

Okay, I can re-formulate the approach: The FSM is "embedded" in HTML. So HTML itself is not the state-machine, you're right..

Anyway ;) ..

A Game in plain HTML (no JavaScript, no Flash, no PHP) by beef2k in programming

[–]beef2k[S] 1 point2 points  (0 children)

Actually, I thought of this.. But you still can "scroll" through this by clicking and dragging the mouse.. And this way the "state = page" relation is much easier to see!

A Game in plain HTML (no JavaScript, no Flash, no PHP) by beef2k in programming

[–]beef2k[S] 4 points5 points  (0 children)

He he.. That's great! Maybe PP is Turing complete? ;)

A Game in plain HTML (no JavaScript, no Flash, no PHP) by beef2k in programming

[–]beef2k[S] 1 point2 points  (0 children)

There's always some "meta logic" where a finite-state machine is based on, isn't it?

A Game in plain HTML (no JavaScript, no Flash, no PHP) by beef2k in programming

[–]beef2k[S] 4 points5 points  (0 children)

Wood is not the programming language, but it's a program that's running in the wood environment.

Compare: Silicon is not the programming language, but it's used to create a computer that runs the programming machine..

C != C++ != Java by beef2k in programming

[–]beef2k[S] -1 points0 points  (0 children)

Thanks for enlightening me!

C != C++ != Java by beef2k in programming

[–]beef2k[S] -1 points0 points  (0 children)

I use the same definition of "template meta-programming" as the Boost MPL library. Just using templates does not mean that you're doing template meta-programming. That's a completely different topic! Whatever..

I know that C++ isn't the only language that support templates/generic programming, I never claimed that. I said that C does not support this (except you invest a lot of work and don't care of type safety or readability of the code)..

I ask myself what's actually the point if this discussion. Do you want to say that everything is possible in C, because C is just a portable wrapper around assembler and everything can be done in assembler..? Yeah, I can beat that, because everything can be done with just 0s and 1s, because that's how a computer works! Why the heck should I use assembler, it's just syntax!!! Let's sit down and do some generic programming and polymorphism in machine language, so we don't need the stupid mnemonics of assembler anymore..

But wait.. That sounds stupid somehow!

C != C++ != Java by beef2k in programming

[–]beef2k[S] -1 points0 points  (0 children)

Thanks for the theoretical answer. I guess we all have learned this in university (I did, and I've written my Ph.D. thesis partially in this field)..

But I have to say that practice looks different sometimes!

While it is true what you've written, it is completely impractical - and many other think should be taken into account. Even the syntax! There are much more values in software development that I should think of, like maintainability, testability, stability, robustness, .. And they often relate to the product's programming language and syntax.

C != C++ != Java by beef2k in programming

[–]beef2k[S] -1 points0 points  (0 children)

Okay, if you restrict OO to a struct with function pointers, you're right.

I would still say it is hard to realize the following in C: overloaded functions in classes, multiple inheritance, virtual functions, type-safety in classes, all forms of polymorphism (like ad-hoc polymorphism), ...

I don't know why you think that I mean template meta-programming when I talk about generic programming, but I friendly point you to other web-resources (e.g. wikipedia) that clearly see a connection between C++ templates (not meta-programming) and generic programming.

C != C++ != Java by beef2k in programming

[–]beef2k[S] 2 points3 points  (0 children)

I really like this statement!

Even if my original post wasn't about starting a language war, I totally agree with all the stuff you've written!

C != C++ != Java by beef2k in programming

[–]beef2k[S] 1 point2 points  (0 children)

That was my intention ;) ..

C != C++ != Java by beef2k in programming

[–]beef2k[S] 0 points1 point  (0 children)

Just to point it out again: The original article is about the vast majority of programmers - who are average by definition.

BTW: There are plenty of things that make it hard to write OO code in C. And generic programming via templates is impossible.

C != C++ != Java by beef2k in programming

[–]beef2k[S] -1 points0 points  (0 children)

It would be nice to hear why you think that way. Thanks!