GithubHelp home page GithubHelp logo

esseks / monicelli Goto Github PK

View Code? Open in Web Editor NEW
1.3K 65.0 55.0 286 KB

An esoteric programming language, come se fosse antani.

License: GNU General Public License v3.0

CMake 3.62% C++ 91.46% Ragel 4.93%

monicelli's Introduction

Monicelli 2.x "Cofandina"

This all-new release mainly brings several improvements to the code that make it easier to hack and build new features. In addition to that:

  • mcc now produces an executable by default, no need to use (or install) lcc, as it was previously the case. mcc cofandina.mc -o cofandina and that's it! This feature currently requires a POSIX system (like Linux or Mac OS X) with a C compiler installed (anything reasonably recent will do).

  • mcc does not depend on Boost anymore.

  • mcc has a new hand-written parser that should provide better error messages. Now it's easier to stuzzicate your prematurated supercazzole. Error messages are in plain English and not very antani. Apologies for that.

  • mcc now generates code that directly calls the C standard library. This allows you to seamlessly link Monicelli object files with C/C++ code, without any extra dependency on a Monicelli standard library.

  • The code generator in mcc has been ported to LLVM 6.0 and will continue to be updated with new releases.

  • Modules are gone. This was a rather obscure feature that allowed to expose functions implemented in C/C++ to Monicelli code using a YAML-based language. Instead, it's now possible to declare a function with an empty body to signal that it will be implemented in another file, be it in Monicelli or C/C++. See the updated Turtle example.

  • The C++ transpiler is gone. It might come back again, though.

What's Monicelli anyway?

Monicelli is an esoterical programming language based on the so-called "supercazzole" from the movie Amici Miei, a masterpiece of the Italian comedy.

Over the past few years I have tried to render the idea of "supercazzola" to non-Italian speakers, with little success. The closest I got was by describing it as "comically deceptive gibberish", which sadly does not capture the true essence of what a "supercazzola" (spelled "supercazzora" according to some) is. I'm still open to suggestions on how to better present Monicelli (the language) to the international public.

Compilation

A part of the Monicelli compiler (the lexer) is generated using ragel, which you will need to have installed. If this is not the case, the configuration script will warn you. Monicelli is developed with version 6.8, but any sufficiently recent release should do just fine.

You will also need to have LLVM development libraries installed, version 14. Newer versions might or might not work. CMake looks for version 14 by default, you can override this by setting the MONICELLI_LLVM_VERSION variable:

$ cmake -DMONICELLI_LLVM_VERSION=15

Finally, you will need CMake, version 3.14 or higher.

A typical Makefile-based build workflow would be:

$ cd monicelli/
$ mkdir build/
$ cd build/
$ cmake .. -DCMAKE_INSTALL_PREFIX="$HOME/mcc"
$ make all install

If your tools are installed in non-standard locations (e.g. Homebrew on Mac OS X), you can alter the search path with:

$ PATH=/path/to/ragel cmake ..

mcc statically links LLVM, once compiled it will only depend on the C++ runtime and on libz.

Note for non-POSIX platforms (like Windows)

The external linker is called using fork+exec for simplicity. This means that this part of the workflow will not work on non-POSIX systems, such as Windows. There, you will need to disable this feature at build time. You will only get object files (.o) that you will have to link, including a C runtime library, by yourself.

You can disable the invocation of an external linker and make mcc compilable on Windows during CMake configuration by forcing the appropriate flag to OFF:

$ cmake .. -DMONICELLI_LINKER=OFF

Tested platforms

The reference OS for building and testing Monicelli is the most recent Ubuntu LTS. If the build is broken there, then it's a bug. It should also compile on Windows, as well as many more POSIX systems, including Mac OS X. If you needed a patch to compile Monicelli on your favourite platform, please send us a pull request!

Usage

Monicelli build an executable by default on POSIX systems (such as Linux, Mac OS X). Linking requires an external C compiler, anything decently modern and standard-conformant should do.

A typical invocation is very similar to what you would expect from your C compiler:

$ mcc example.mc -o example
$ ./example

Please be aware that the Monicelli compiler depends on the availability of a C compiler and stdlib, although this dependency should be available on virtually all platforms where you might think to run mcc.

Language overview

The original specification can be found in Specification.txt, and was initially conceived by my colleagues and dear friends Alessandro Barenghi, Michele Tartara and Nicola Vitucci, to whom goes my gratitude.

Their proposal was meant to be an elaborate joke and is not complete. This project is an ongoing effort to produce a rigorous specification for the language and implement a compiler, which implies filling gaps and ambiguities with sensible choices.

Statements have no terminator, i.e. no semicolon ; or the like. A single statement can be split across multiple lines and multiple statements can be grouped on the same line. However, keywords consisting of multiple space-separed words cannot be split on multiple lines.

A comma might be inserted after each statement, if it fits the sentence ;)

Accented letters can be replaced by the non-accented letter followed by a backtick `, although the use of the correct Italian spelling is strongly encouraged for maximizing the antani effect.

Getting started real quick

For those of you who want to get to the code ASAP, the examples/ folder contains a set of programs covering most of the features of the language.

Main

The entry point of the program (the "main") is identified by the phrase:

Lei ha clacsonato

which marks the beginning of the supercazzola (i.e. of the program).

A value can be returned by using the the following statement:

vaffanzum <expression>!

optionally, no value might be returned with:

vaffanzum!

Expressions

The usual operators are given, but spelled as words to best fit in sentences. They are directly mapped on usual operators as follows:

Form Maps to
più +
meno -
per *
diviso /
maggiore di >
minore di <
maggiore uguale a/di >=
minore uguale a/di <=

So 2 più 4 means 2 + 4. maggiore o uguale is admitted as alternate form of the >= operator, same for minore o uguale.

When evaluating binary expressions whose operands have different types, the type of the result will be the less restrictive between the two. This ensures that no loss takes place when evaluating an expression.

Binary shift

Binary shift operators have a slighly different syntax:

<what> con scappellamento a <direction> per <bits>

which is equivalent to what >> bits or what << bits, depending on the direction, which is specified as follows:

Phrase Direction
destra right
sinistra left

as you might have noticed, those are simply the translation in Italian of "left" and "right". For instance:

antani con scappellamento a sinistra per 2

maps to antani << 2.

It goes without saying, other expression can be used instead of numbers. Also, the usual precedence rules apply.

There is no syntax for braces in Monicelli.

Variables

A variable name can contain numbers, upper and lower case character and must not start with a number (the usual rules, that's it).

A variable might be prefixed with an article to fit a sentence. The compiler does not check concordance with the following name, but accepts any article of the Italian language: il, lo, la, i, gli, le, un, una dei, delle, l', un'. For instance, cappello and il cappello refer to the same variable.

Consequently, the articles above cannot be used as variable names.

Assignment

A value can be assigned to a variable with the following statement:

<varname> come fosse <expression>

the alternate spelling come se fosse can be used as well.

The <expression> initializer is casted to the declared type of the variable, even if the cast will cause some loss. This feature can be (ab)used to introduce C-style casts too.

Declaration

Variables can be declared in any scope. There are 5 variable types, which are directly mapped on C++/C99 types as follows:

Type name Mapped C type Size
Necchi int 64bit
Mascetti char 8bit
Perozzi float 32bit
Melandri bool -
Sassaroli double 64bit

A variable is declared with the following statement:

voglio <varname>, <type>

an initialization value can be provided:

voglio <varname>, <type> come se fosse <expression>

for instance:

voglio antani, Necchi come se fosse 4

declares a variables called antani of type Necchi (int) and initializes it to 4.

Input/Output

Variables and expressions can be printed with the statement:

<expression> a posterdati

Conversely, a variable might be read from input using:

mi porga <varname>

Loop

There is only one loop construct, equivalent to a C do {} while();, which is defined as follows:

stuzzica
    <statements>
e brematura anche, se <condition>

For example:

voglio antani, Necchi come se fosse 10
stuzzica
    antani come fosse antani meno 1
e brematura anche, se antani maggiore di 0

maps to:

int antani = 10;
do {
    antani = antani - 1;
} while (antani > 0);

brematura might be replaced by its alternate form prematura

Branch

The branch construct encompasses both the features of an if and a switch. The best way to explain it is by comparing its various forms to the corresponding C translation.

This is the general form:

che cos'è <variable>?
    <condition>:
        <statements>
    o magari <condition>:
        <statements>
    o tarapia tapioco:
        <statement>
e velocità di esecuzione

where <condition> might be either a value or a semi-expression, that is an operator followed by any expression. For instance:

che cos'è il genio?
    intuizione:
        genio come se fosse genio meno 1
    o magari intuizione diviso 2:
        genio come se fosse genio più 1
    o magari maggiore di mobiletto per due:
        genio come se fosse genio per 2
    o tarapia tapioco:
        genio come se fosse 2
e velocità di esecuzione

maps to:

if (genio == intuizione) { 
    genio = genio - 1;
} else if (genio == (intuizione / 2)) {
    genio = genio + 1;
} else if (genio > (mobiletto * 2)) {
    genio = genio * 2;
} else {
    genio = 2;
}

The statement can emulate an if () {} else {}:

che cos'è il genio?
    maggiore di mobiletto:
        genio come se fosse 2
    o tarapia tapioco:
        genio come se fosse 0
e velocità di esecuzione

Placing multiple o <condition>: block is similar to a chain of else if in C.

The o tarapia tapioco block can be omitted:

che cos'è il genio?
    maggiore di mobiletto:
        genio come se fosse 2
e velocità di esecuzione

Finally, here is the equivalent of a switch () {}:

che cos'è il genio?
    1:
        genio come se fosse 2
    o magari 2:
        genio come se fosse 7
    o tarapia tapioco:
        genio come se fosse 9
e velocità di esecuzione

where the o tarapia tapioco part is like the default block.

Functions

Note: the alternate spelling supercazzora might be used in place of supercazzola wherever the latter appears.

Declaration

A function is declared with the blinda la supercazzola statement:

blinda la supercazzola [<type>] <name> [con <param> <type>[, <param> <type>...]] o scherziamo?
    <statements>

Where <type> can be omitted for a void function. For instance:

blinda la supercazzola Necchi antanizzata con alfio Mascetti o scherziamo?
    vaffanzum alfio meno 2!

is a function of type Necchi, taking one argument of type Mascetti. Multiple arguments must be comma-separed, like in:

blinda la supercazzola Necchi antanizzata con alfio Mascetti, barilotto Necchi o scherziamo?
    vaffanzum alfio meno 2!

which is a function of type Necchi, taking two arguments of type Mascetti and Necchi. It maps to:

int antanizzata(char alfio, int barilotto) {
    return alfio - 2;
}

Finally, this:

blinda la supercazzola antanizzata o scherziamo?
    vaffanzum!

is a void function taking no arguments and becomes:

void antanizzata() {
    return;
}

Functions cannot be nested and can be declared before or after the main in any order. mcc will not check that a return statement is always reachable inside a non-void function. Failing to return a value leads to undefined behaviour.

A function might be declared with no body, in which case it's treated as a prototype. A prototype makes the function signature known to the compiler, and it signals that the function is implemented in another file.

Invocation

A function is called with the brematurata la supercazzola statement:

brematurata la supercazzola <name> [con <expression>[, <expression>...] o scherziamo?

Functions might be called inside expressions. For instance, this:

antani come se fosse brematurata la supercazzola alfio con barilotto diviso 3 o scherziamo? per 2

maps to:

antani = alfio(barilotto / 3) * 2;

Exceptions

The program might be aborted immediately with the statement:

avvertite don ulrico

there are no arguments.

Assertions

An assertion block will evaluate its expression and trigger an error message if it is found to be 0 (logical false). An assertion is stated as:

ho visto <expression>!

Comments

Any character after bituma is ignored until a line break is encountered. For instance, in:

antani come se fosse 4 bituma, scusi, noi siamo in quattro

, scusi, noi siamo in quattro is ignored.

Comments are useful to fill the "supercazzola" and make it more readable, since any word (including reserved words) can be inserted into it.

Meta comments

In addition to line comments, there are meta comments. A meta comment starts with an hash sign # and continues until a line break is encountered, as an ordinary comment.

They have a different graphical symbol, which can be immediately spotted inside a long "supercazzola". Also, ordinary comments can and should be used in an improper way to fill the sentence, meta comments provide a mechanism for distiguishing "real" comments.

Reserved words and phrases

The following phrases are currently reserved with no assigned usage. They cannot be used as variable identifiers, even if they do not serve any other purpose in the current language revision.

  • conte
  • scusi noi siamo in
  • con rinforzino

monicelli's People

Contributors

agatti avatar alessandropellegrini avatar calamarim avatar esseks avatar nsanitate avatar skeru avatar slattarini avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

monicelli's Issues

README license clarification

Hello!

Thank you for this wonderful software! :)

I have written a compiler for monicelli ("GPLv3 or later" licensed) i would like to include part of your README in my project as language reference; please can you clarify the license of the README file?

Thank you again!
C.

Cmake lists as NOTFOUND the YAML_INCLUDE_DIRS

I'm running OS X, installed yaml-cpp throug brew. Still even exporting YAML_INCLUDE_DIRS and YAML_LIBRARIES as the specific /usr/local/Cellar/yaml-cpp/0.5.3/include/yaml-cpp/ and /usr/local/Cellar/yaml-cpp/0.5.3/include/lib/directories, cmake returns

  CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
  Please set them or make sure they are set and tested correctly in the CMake files:
  YAML_INCLUDE_DIRS
   used as include directory in directory /Users/fabrizio/monicelli-master/src
   used as include directory in directory /Users/fabrizio/monicelli-master/src
   used as include directory in directory /Users/fabrizio/monicelli-master/src
   used as include directory in directory /Users/fabrizio/monicelli-master/src
   used as include directory in directory /Users/fabrizio/monicelli-master/src
   used as include directory in directory /Users/fabrizio/monicelli-master/src
   used as include directory in directory /Users/fabrizio/monicelli-master/src
   used as include directory in directory /Users/fabrizio/monicelli-master/src
   used as include directory in directory /Users/fabrizio/monicelli-master/src

CMake version is 3.5.1
Yaml-cpp is 0.5.3

‘assert’ is not a member of ‘std’

Consider this simple program:

blinda la supercazzola Necchi Fibonacci con il conteggio Necchi o scherziamo?
  voglio un numero, Necchi come se fosse 0
  voglio un altro, Necchi come se fosse un numero più 1
  stuzzica
    un altro come se fosse un numero più altro
    il numero come se fosse l'altro meno un numero
    conteggio come fosse un conteggio meno 1
  e brematura anche, se conteggio maggiore di 0
  #ho visto un numero minore di 0!
  vaffanzum numero!

Lei ha clacsonato
  voglio un dito, Necchi come se fosse 42
  mi porga il dito
  voglio antani, Necchi come fosse brematurata la supercazzola Fibonacci con un dito o scherziamo?
  antani a posterdati

removing the # from "#ho visto un numero minore di 0!" makes the compilation fail with:

:14:5: error: ‘assert’ is not a member of ‘std’
     std::assert(numero < 0);

monicellizer

It would be great to think about a monicelizzer, in order to spread the supercazzola around the source code.
I'd like to translate bitcoin core source code in monicelli source code, in order to explore AntaniCoins world

Can't link due to ' undefined reference to symbol'.

Hi, i can't compile due to an error on the linking step:

[ 7%] Linking CXX executable mcc
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: CMakeFiles/mcc.dir/BitcodeEmitter.cpp.o: undefined reference to symbol '_ZN4llvm28createBasicAliasAnalysisPassEv'
/usr/lib64/libLLVMAnalysis.so.3.7: error adding symbols: DSO missing from command line

Ps: I have applied the patch for use bison 2.7

Thank you

Compiler should output and read to/from file

Current behaviour is reading from stdin and writing to stdout. We should allow file I/O.

I propose the following behaviour:

  1. If a filename is specified, e.g. example.mc, read from it and emit example.cpp (replacing the mc suffix with cpp).
  2. A different name for the output file might be specified by supplying a second argument.
  3. Specifying - as first or second argument connects the input/output to stdin/stdout.
  4. Not specifying any argument means read from stdin and write to stdout.

Can't compile the compiler

Hi everyone. I was trying to "install" Monicelli on my computer to play with it but I had a problem. First I used $git clone to clone your repository into a folder called "monicelli", then I used $cmake monicelli to generate the needed configuration and until here, everything went fine. Then I run the $make program but it terminated with two errors, here's the full output:

[giacomo@giacomo-tower ~]$ make
[ 7%] [FLEX][Scanner] Building scanner with flex 2.6.0
[ 14%] [BISON][Parser] Building parser with bison 3.0.4
Scanning dependencies of target mcc
[ 21%] Building CXX object src/CMakeFiles/mcc.dir/main.cpp.o
[ 28%] Building CXX object src/CMakeFiles/mcc.dir/Nodes.cpp.o
[ 35%] Building CXX object src/CMakeFiles/mcc.dir/CLineParser.cpp.o
[ 42%] Building CXX object src/CMakeFiles/mcc.dir/ModuleRegistry.cpp.o
[ 50%] Building CXX object src/CMakeFiles/mcc.dir/ModuleLoader.cpp.o
[ 57%] Building CXX object src/CMakeFiles/mcc.dir/Parser.cpp.o
[ 64%] Building CXX object src/CMakeFiles/mcc.dir/Lexer.cpp.o
/home/giacomo/src/Lexer.cpp: In member function ‘virtual int monicelli::Scanner::yylex()’:
/home/giacomo/src/Lexer.cpp:928:23: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
for ( yyl = 0; yyl < yyleng; ++yyl )
^
At global scope:
cc1plus: error: unrecognized command line option ‘-Wno-deprecated-register’ [-Werror]
cc1plus: all warnings being treated as errors
src/CMakeFiles/mcc.dir/build.make:218: set di istruzioni per l'obiettivo "src/CMakeFiles/mcc.dir/Lexer.cpp.o" non riuscito
make[2]: *** [src/CMakeFiles/mcc.dir/Lexer.cpp.o] Errore 1
CMakeFiles/Makefile2:87: set di istruzioni per l'obiettivo "src/CMakeFiles/mcc.dir/all" non riuscito
make[1]: *** [src/CMakeFiles/mcc.dir/all] Errore 2
Makefile:149: set di istruzioni per l'obiettivo "all" non riuscito
make: *** [all] Errore 2

Seems to me that trying to compile using different flags could work, but I'm not sure about what to do. Thanks for your help

Make doesn't work

Sto riscontrando problemi durante la fase di installazione.
Con il comando $ git clone https://github.com/esseks/monicelli.git ho scaricato la cartella.
Poi ho creato la cartella build e al suo interno ho eseguito il comando $ cmake .., fin qui tutto bene.
Poi provo il comando $ make e ottengo questo errore:

[  7%] [FLEX][Scanner] Building scanner with flex 2.6.1
[ 14%] [BISON][Parser] Building parser with bison 3.0.4
Scanning dependencies of target mcc
[ 21%] Building CXX object src/CMakeFiles/mcc.dir/main.cpp.o
[ 28%] Building CXX object src/CMakeFiles/mcc.dir/Nodes.cpp.o
[ 35%] Building CXX object src/CMakeFiles/mcc.dir/CLineParser.cpp.o
[ 42%] Building CXX object src/CMakeFiles/mcc.dir/ModuleRegistry.cpp.o
[ 50%] Building CXX object src/CMakeFiles/mcc.dir/ModuleLoader.cpp.o
[ 57%] Building CXX object src/CMakeFiles/mcc.dir/Parser.cpp.o
[ 64%] Building CXX object src/CMakeFiles/mcc.dir/Lexer.cpp.o
/home/ncvescera/Scrivania/monicelli/cmake/src/Lexer.cpp: In member function ‘virtual int monicelli::Scanner::yylex()’:
/home/ncvescera/Scrivania/monicelli/cmake/src/Lexer.cpp:916:23: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
    for ( yyl = 0; yyl < yyleng; ++yyl )
                   ~~~~^~~~~~~~
At global scope:
cc1plus: error: unrecognized command line option ‘-Wno-deprecated-register’ [-Werror]
cc1plus: all warnings being treated as errors
src/CMakeFiles/mcc.dir/build.make:218: set di istruzioni per l'obiettivo "src/CMakeFiles/mcc.dir/Lexer.cpp.o" non riuscito
make[2]: *** [src/CMakeFiles/mcc.dir/Lexer.cpp.o] Errore 1
CMakeFiles/Makefile2:87: set di istruzioni per l'obiettivo "src/CMakeFiles/mcc.dir/all" non riuscito
make[1]: *** [src/CMakeFiles/mcc.dir/all] Errore 2
Makefile:149: set di istruzioni per l'obiettivo "all" non riuscito
make: *** [all] Errore 2

error: no viable conversion from 'std::ostream' (aka 'basic_ostream<char>') to 'bool'

I'm trying to compile Monicelli on Mac OSX 10.10.3 (HEAD is at 8aa5c1a), but make stops badly:

[  8%] [FLEX][Scanner] Building scanner with flex 2.5.35
[ 16%] [BISON][Parser] Building parser with bison 3.0.4
Scanning dependencies of target mcc
[ 25%] Building CXX object src/CMakeFiles/mcc.dir/main.cpp.o
[ 33%] Building CXX object src/CMakeFiles/mcc.dir/Nodes.cpp.o
[ 41%] Building CXX object src/CMakeFiles/mcc.dir/CLineParser.cpp.o
[ 50%] Building CXX object src/CMakeFiles/mcc.dir/ModuleRegistry.cpp.o
[ 58%] Building CXX object src/CMakeFiles/mcc.dir/ModuleLoader.cpp.o
[ 66%] Building CXX object src/CMakeFiles/mcc.dir/Parser.cpp.o
[ 75%] Building CXX object src/CMakeFiles/mcc.dir/Lexer.cpp.o
[ 83%] Building CXX object src/CMakeFiles/mcc.dir/CppEmitter.cpp.o
~/monicelli/src/CppEmitter.cpp:48:12: error: no viable conversion from 'std::ostream' (aka 'basic_ostream<char>') to 'bool'
    return stream;
           ^~~~~~

[many other identical errors at lines 78, 87, 96, 101, etc.....]

I'm not a CPP expert and really don't know how to help :/

Compilation Fails on MinGW

While I was trying to compile monicelli in MinGW I got the following errors:

1. Boost native() assumes std::string is made of wchar_t under windows

main.cpp:112:81: error: conversion from 'const string_type {aka const std::__cxx11::basic_string<wchar_t>}' to non-scalar type 'std::__cxx11::string {aka std::__cxx11::basic_string<char>}' requested

I think it's not a mistake on monicelli's part (I think boost assumes that all string are wchar in windows), however judging from the boost documentation string() would be a more fitting option, e.g.

std::string outputname = boost::filesystem::path(name).filename().string();

2. CppEmitter fuctions expect bool return and instead get ostream

CppEmitter.cpp: In member function 'virtual bool monicelli::CppEmitter::emit(const monicelli::Program&)':
CppEmitter.cpp:78:12: error: cannot convert 'std::ostream {aka std::basic_ostream<char>}' to 'bool' in return
return stream;
       ^

(a.k.a. #27)
I'm unsure whether it's an unimplemented feature of the GCC I'm using or some linux-only autoconversion. According to this example the typecast should be explicit.

Build Details

The following packages were used to compile:
Mingw x86/64 sjlj with pthreads
msys2-provided flex
msys2-provided bison
As for the rest:

They've been compiled from source with the respective checkouts/tars
The cmake (3.2.2) was run with the following command

cmake .. -G "MSYS Makefiles" -DCMAKE_INSTALL_PREFIX=/opt/monicelli -DCMAKE_BUILD_TYPE=RELEASE -DBOOST_INCLUDEDIR=/opt/boost/include/boost-1_59 -DBOOST_LIBRARYDIR=/opt/boost/lib -DLLVM_DIR=/opt/llvm/share/llvm/cmake -DYAML_INCLUDE_DIRS=/opt/yaml-cpp/include -DYAML_LIBRARIES=/opt/yaml-cpp/lib/libyaml-cpp.a -DCMAKE_CXX_FLAGS="-I/usr/include"

P.S. Kudos for the awesome language

Should be easier to build

Is it possible to have a Makefile or a ./configure?
I'm unable to build on Ubuntu 14.04.

$ sudo apt-get install cmake bison

... e poi?

Add matrices to Monicelli

Hi

In English just for the casual github reader.

Can I propose a syntax for "arrays"?

tavola [al <variable>] [per <N>]*

So you can now declare a matrix 2x2 (using the usual C semantics) as

voglio una tavola al papero per due per due, Necchi

Then you can access it with

al posto <N> [e [al posto] <M>]* del <variabile>

To get the element in position 1, 1 in the previous example you can say

al posto uno e uno del papero

Which has a nice "mascettian" ring to it.

Just a thought :)

Cheers

MA

Scusi noi siamo in array []

I hope that this keyword or one other one is reserved to enable in Monicelli the feature of arrays, am I right?

Is there a way without it to use strings, matrix or something else now?

Anyway, chapeau, you made my day (^^)/

typo? spelling error?

"brematura" and "brematurata" is wrong, "prematura" and "prematurata" should be used instead for correct amici miei spelling

trouble compilation

Hello, I use ubuntu and have trouble:

$ cmake ..
== Only a limited set of platforms was tested. We need your help!
== Report build errors to https://github.com/esseks/monicelli/issues
-- Boost version: 1.54.0
-- Found the following Boost libraries:
--   regex
--   system
--   filesystem
--   program_options
CMake Error at /usr/share/llvm-3.5/cmake/LLVMConfig.cmake:50 (include):
  include could not find load file:

    /usr/lib/llvm-3.5/share/llvm/cmake/LLVMExports.cmake
Call Stack (most recent call first):
  src/CMakeLists.txt:34 (find_package)


CMake Error at /usr/share/llvm-3.5/cmake/LLVMConfig.cmake:53 (include):
  include could not find load file:

    /usr/lib/llvm-3.5/share/llvm/cmake/LLVM-Config.cmake
Call Stack (most recent call first):
  src/CMakeLists.txt:34 (find_package)

CMake Error at src/CMakeLists.txt:74 (llvm_map_components_to_libnames):
  Unknown CMake command "llvm_map_components_to_libnames".

-- Configuring incomplete, errors occurred!

I have llvm-3.5 and the file exists:

$ls -l /usr/share/llvm-3.5/cmake/LLVMConfig.cmake
-rw-r--r-- 1 root root 13472 lut 12  2015 /usr/share/llvm-3.5/cmake/LLVMConfig.cmake

what is wrong?

A tribute song (not an issue)

Do you know Suno AI? Well, now you do! (simply put, they made a text-to-music model)
I made a song using the Fibonacci sequence example as the lyrics.
I hope you'll get a laugh out of it, as I have with your language.
Enjoy!

Fibonacci

Now it's only accessible via link, but I'd like to make it public, if you're ok with it.

monicelli should accept more keyword

I tried to write some little programs using this language, like this one: http://pastebin.com/1ejFeQNs that takes in input vassoio and prints the Fibonacci numbers from 0 to vassoio.

Well, I think the supercazzola is not enough fluent, there are a lot of "come se fosse" and "voglio", like in a real c++ program there are a lot of declaration and assignment.
In order to make the program more various, I think it must accept more keyword to do the same things and treat the unknown ones as comment.

Expand Monicelli syntax

Sounds like in the international context of anonymity nerd sitting in IRC on #nottor channel at irc.oftc.net (where Tor Community lounge have pleasure-time) the terms "supercazzola" has been associated with "Prisencolinensinainciusol":

naif
8:16 if i tell you
8:16 "Supercazzola"
8:16 that's an italian word
8:16 what's the first thing that come to your mind
8:16 representing the meaning of "Supercazzola" word?
Stevko
8:25 naif: first thing? Prisencolinensinainciusol
8:25 http://en.wikipedia.org/wiki/Prisencolinensinainciusol

This ticket is to evaluate the extraordinary inclusion of Prisencolinensinainciusol in the monicelli's syntax to improve the international adoption and understanding of such a new technology

LLVM 9

non va con llvm perchè richiede la versione 6. Nessun modo di farlo andare con versioni più aggiornate?

[END] doen't work with llvm 9, requested version is 6. Any way to get work with updated version?
image

MCC should be able to directly output the executable.

Hello,
just an idea here, we could exploit the libclang APIs in order to directly compile the generated C++ code into an executable. This will allow the future developers to write more sophisticated code using only mcc, thus letting MCC to break into the world of real production-ready compilers.
I can only imagine the future of the CS universities, teaching Monicelli instead of that shitty Java.

We might probably add an option to mcc (-c?) to avoid the compilation and generate only the intermediary code.

The drawback is that we might probably have to migrate the compilation of mcc to clang++ as I'm not 100% sure the ABIs are compatible.

Error in README on the greater/lower than operators

It is stated in the README that the greater than (>=) operator is represented by "maggiore uguale a/di", however you get a compile error if you don't use the 'o' as in "maggiore o uguale a/di"; the same applies to the lower than (<=) operator "minore uguale a/di".

Typo or design

Supercazzola is for sure the most common and spread spelling of this modernist neologism. But the correct spelling, present on the book, is supercazzora.

Extend and Complete uses of Amici Miei dictionary in Monicelli's Syntax

This ticket is to approach a structure analysis of the completeness of uses of Amici Miei dictionary.

By reaching 100% coverage of Amici Miei syntax, we may improve the overall language semantic, with related Sbiriguda-level improvements and consequent embedded protection against heap overflow exploits.

To do so we shall list/collect the right set of of authority data sources, define an appropriate methodology of text processing (considering semantic analysis, if needed), map the existing syntax of Monicelli compared to the complete dictionary result of the analysis.

As a valuable data source i suggest the old, but ever green, "I leggendari testi delle supercazzole" from www.webalice.it/nigelmansell/amicimieisupercazzole.html .

Online compiler

Would it be feasible to have an online Monicelli compiler like many other eso-langs (Cjam, Pyth, ...)? I'd like to send my codegolf entries in this language

Should docs be built under $INSTALL_PREFIX/share/doc instead of $INSTALL_PREFIX/doc?

Following the build instructions:

$ cd monicelli/
$ mkdir build/
$ cd build/
$ cmake .. -DCMAKE_INSTALL_PREFIX="$HOME/mcc"
$ make all install

creates the following files in $HOME/mcc:

~/mcc $ tree .                  
.
├── bin
│   └── mcc
└── doc
    └── monicelli
        ├── LICENSE.txt
        └── README.md

3 directories, 3 files

On *nix systems, docs are usually under: share/doc/<proj>/doc, i.e.:

  • /usr/local/share/doc
  • /usr/share/doc

so if building with -DCMAKE_INSTALL_PREFIX="/usr/local":

cmake .. -DCMAKE_INSTALL_PREFIX="/usr/local"

should install:

  • /usr/local/bin/mcc
  • /usr/local/share/doc/monicelli/LICENSE.txt
  • /usr/local/share/doc/monicelli/README.txt

instead it of installing:

  • /usr/local/bin/mcc
  • /usr/local/doc/monicelli/LICENSE.txt
  • /usr/local/doc/monicelli/README.txt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.