esseks / monicelli

An esoteric programming language, come se fosse antani.
GNU General Public License v3.0
1.32k stars 52 forks source link

Hello World plus minor change #7

Closed alessandropellegrini closed 9 years ago

alessandropellegrini commented 9 years ago

Essentially, this pull requests adds a Hello World example (working on my machine). What is a new programming language without a hello world example?

The code simply prints Hello World on screen. The code is quite long to make fun with the language, and to avoid a very repetitive supercazzola to print out one char at a time.

There is as well some minor changes to the code: I have converted integer/float conversion from c++11 to older code, as we cannot suppose the availability of a newer compiler.

esseks commented 9 years ago

There are a few unrelated things grouped in this PR, so I will try and get to the points in order:

  1. Bison/Flex output is not supposed to be in the .gitignore, since it's a build byproduct that should be cleaned up and not ignored, a thing the current Makefile does. Also, I have an experimental branch with CMake support which builds out-of-tree, meaning that those files will be tucked in a build/ directory or maybe even outside the root directory.
  2. atoi and atof are deprecated and not safe, I think you meant strtol and strtod. Anyway, the codebase relies extensively on C++11 features (range based iteration, strongly typed enums etc.), out of number parsing routines. I see no reason why I should refrain from adopting a mature standard which brings a lot of benefits. Chances are your default compiler already supports all the required features and if it doesn't, an upgrade is strongly recommended. Consider that the Debian stable toolchain can compile Monicelli, and it's sporting a compiler that was released more than 2 years ago.
  3. I really like the Hello World and would like to insert it as an example. Since it's not a minor fix but a substantial contribution, I ask you to place it under an appropriate license: public domain or GPLv3 compatible. If you wish, you can add a (meta) comment to the file crediting you for the hard work :smile: .
alessandropellegrini commented 9 years ago

I see you point concerning .gitignore, and I actually agree, so that change is reverted.

As for second point, actually I'm currently working on a windows project, and no, C++11 is not fully supported on cygwin. But I agree on pushing towards the wide adoption of the new standard, so I have reverted that change as well.

I have added a meta comment with my name/contact and the GPLv3 licensing notice in the example. In any case, it was written explicitly to be included in the project, if you were liking it! So feel free to use it as you prefer!

esseks commented 9 years ago

I see. Unfortunately, Cygwin G++ is really old (4.5.2, dates back to 2010), and I am not willing to support it unless there is a strong demand. The minimum requirement is set to G++ 4.6.3, the default compiler for Ubuntu 12.04 LTS. You might want to try Clang++, which is more up to date in Cygwin, AFAIK.

I took the liberty of clustering all the commits into a single one that introduces hello-world.mc in order to keep the history clean. Thanks for contributing.

alessandropellegrini commented 9 years ago

Thanks for the suggestion, but anyhow cygwin is not my common development environment, so it doesn't matter this much.

Yes, sorry, I really messed up with the commits this time. You are very welcome, and thanks for this amazing project!