Giter VIP home page Giter VIP logo

emojicode.github.io's Introduction

Emojicode Build Status Join the chat at https://gitter.im/emojicode/emojicode

Emojicode is an open source, high-level, multi-paradigm programming language consisting of emojis. It features Object-Orientation, Optionals, Generics and Closures.

๐Ÿ Getting Started

To learn more about the language and how to install Emojicode visit https://www.emojicode.org/.

We highly recommend to follow Emojicodeโ€™s Twitter account @Real_Emojicode to stay up with the latest.

๐Ÿ”จ Building from source

๐Ÿก Building locally

Prerequisites (versions are recommendations):

  • clang and clang++ 6.0.1 or gcc and g++ 7.2
  • CMake 3.5.1+ and (preferably) Ninja
  • LLVM 7
  • Python 3.5.2+ for testing

Steps:

  1. Clone Emojicode (or download the source code and extract it) and navigate into it:

    git clone https://github.com/emojicode/emojicode
    cd emojicode
  2. Create a build directory and run CMake in it:

    mkdir build
    cd build
    cmake .. -GNinja

    You can of course also run CMake in another directory or use another build system than Ninja. Refer to the CMake documentation for more information.

  3. Build the Compiler and Packages:

    ninja
  4. You can now test Emojicode:

    ninja tests
  5. The binaries are ready for use! You can the perform a magic installation right away

    ninja magicinstall

    or just package the binaries and headers properly

    ninja dist

    To create a distribution archive you must call the dist script yourself (e.g. python3 ../dist.py .. archive).

๐Ÿ‹ Building using Docker

A Dockerfile is available for building in a Ubuntu 18.04 environment.

Steps:

  1. Clone Emojicode (or download the source code and extract it) and navigate into it:

    git clone https://github.com/emojicode/emojicode
    cd emojicode
  2. Build Docker image:

    docker build -t emojicode-build -f docker/clang .
  3. Verify the installation was fine and tests pass:

    docker run --rm emojicode-build
    ...
    โœ… โœ…  All tests passed.
    
  4. Start image (and mount a directory to it):

    docker run --rm -v $(pwd)/code:/workspace -it emojicode-build /bin/bash
  5. Start coding!

    emojicodec /workspace/hello.๐Ÿ‡ && ./workspace/hello

๐Ÿ“ƒ License

Emojicode is licensed under the Artistic License 2.0. If you donโ€™t want to read the whole license, hereโ€™s a summary without legal force:

  • You are allowed to download, use, copy, publish and distribute Emojicode.
  • You are allowed to create modified versions of Emojicode but you may only distribute them on some conditions.
  • The license contains a grant of patent rights and does not allow you to use any trademark, service mark, tradename, or logo.
  • Emojicode comes with absolutely no warranty.

emojicode.github.io's People

Contributors

abethcrane avatar apriljgranzow avatar ayowel avatar benestar avatar bhainesva avatar bombless avatar chrischuck avatar daniarnaout avatar devprice avatar joeskeen avatar joshgrib avatar julianschacher avatar kawanerio avatar libcthorne avatar linkcoding avatar marianoalipi avatar marxsoul55 avatar maximumtiu avatar meithecatte avatar mrctje avatar nicgarner avatar parndt avatar quentin-dev avatar rafal-spryszynski avatar sjwarner avatar sonnynomnom avatar thbwd avatar tmose1106 avatar zstephenj avatar zvakanaka 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

Watchers

 avatar  avatar  avatar  avatar  avatar

emojicode.github.io's Issues

Invalid Examples in Classes & Value Types Language Reference

The example in Mutability of Value Types which calls the ๐Ÿ— method on credit_card is rejected by the compiler with ๐Ÿšจ error: _๐Ÿ’ณ has no suitable ๐Ÿ— because ๐Ÿ— expects a string argument.
(Bonus typo in the same section: "Only value types in a mutable variables are mutable" in that section should either drop the "a" or change "mutable variables" to singular.)

The example code in Type Methods is rejected by the compiler (Emojicode-1.0-beta.2-Darwin-x86_64).

๐Ÿ‡ ๐Ÿ• ๐Ÿ‡
  ๐Ÿ“— Return available pizza dishes. ๐Ÿ“—
  ๐Ÿ‡โ—๏ธ ๐Ÿ“œ โžก๏ธ ๐Ÿจ๐Ÿš๐Ÿ”ก๐Ÿ† ๐Ÿ‡
    โ†ฉ๏ธ ๐Ÿจ ๐Ÿ”คMargherita๐Ÿ”ค ๐Ÿ”คTonno๐Ÿ”ค ๐Ÿ”คQuattro Formaggi๐Ÿ”ค ๐Ÿ†
  ๐Ÿ‰
๐Ÿ‰
pizza.emojic:3:5: ๐Ÿšจ error: Unexpected token DocumentationComment.
    ๐Ÿ“— Return available pizza dishes. ๐Ÿ“—
    โฌ†๏ธ

Removing the documentation section results in the error

pizza.emojic:3:6: ๐Ÿšจ error: Expected Identifier but instead found EndOfArguments(โ—).
    ๐Ÿ‡โ—๏ธ ๐Ÿ“œ โžก๏ธ ๐Ÿจ๐Ÿš๐Ÿ”ก๐Ÿ† ๐Ÿ‡
     โฌ†๏ธ

I suspect it would also balk at the return line for using ๐Ÿจ instead of ๐Ÿฟ.

Code examples are not shown correctly

I'm sure it is just that I need to install/configure something, but I don't know what and it would be a good idea to add an explanation somewhere en the page.

Screenshot

Magic Installation is broken

Magic installation seems to be broken for the latest version on Linux, seems to be a simple problem of the latest release file names not being consistent with past versions, breaking the Magic Installation code generation script.

Rework demo code on front page

I think that demo is quite good, but we missed a big chance by writing out 'hello world' instead of using the correct emoji for that sentence. It just has to be:

๐Ÿ‘‹๐ŸŒŽ

no way around it. Currently it just feels so uncomfortably incomplete.

Invalid Example in Protocol Guide

The example in Calling Methods on Protocol Types does not compile with Emojicode-1.0-beta.2-Darwin-x86_64:

๐ŸŠ ๐Ÿ’ฟ ๐Ÿ‡
  โ—๏ธ๐ŸŽถ
๐Ÿ‰

๐Ÿ‡  ๐Ÿ“ฑ ๐Ÿ‡
  ๐ŸŠ ๐Ÿ’ฟ

  โ—๏ธ ๐ŸŽถ ๐Ÿ‡
    ๐Ÿ˜€ ๐Ÿ”คLalalala๐Ÿ”คโ—๏ธ
  ๐Ÿ‰
๐Ÿ‰

๐Ÿ๐Ÿ‡
  ๐Ÿ– ๐Ÿ†• cd_like ๐Ÿ’ฟ
  ๐Ÿ†•๐Ÿ“ฑ  โžก๏ธ ๐Ÿ–  cd_like
  ๐ŸŽถ cd_likeโ—๏ธ
๐Ÿ‰

produces

protocol.emojic:15:7: ๐Ÿšจ error: Unexpected token RightProductionOperator.
  ๐Ÿ†•๐Ÿ“ฑ  โžก๏ธ ๐Ÿ– cd_like
      โฌ†๏ธ

Changing the assignment line to ๐Ÿ†•๐Ÿ“ฑ โ—๏ธ โžก๏ธ ๐Ÿ– cd_like (addition of โ—๏ธ) produces

protocol.emojic:15:3: ๐Ÿšจ error: _๐Ÿ“ฑ has no suitable ๐Ÿ†•.
  ๐Ÿ†•๐Ÿ“ฑ โ—๏ธ โžก๏ธ ๐Ÿ– cd_like
  โฌ†๏ธ

Additionally, the BNF for protocol does not specify that it uses the grapes-watermelon ๐Ÿ‡๐Ÿ‰ block delimiters to surround the protocol-body, but all of the examples imply that it's required.

Confusing example on classes page

"This calls the ๐ŸŽฑ class method on the class ๐Ÿช in namespace ๐Ÿ•š."

Where did class ๐Ÿช and namespace ๐Ÿ•š come from? They're never referenced before that line.

Control Flow Documentation Issues

  1. The code example for the ๐Ÿ” For-in loop is incorrect. It starts a list declaration with ๐Ÿจ rather than ๐Ÿฟ.
  2. The explanation of ๐Ÿ” For-In compiled bytecode is a bit confusing because it appears before ๐Ÿ” Repeat-While is introduced.
  3. The ๐Ÿ™…โ†ช๏ธ Else-If section is confusing. The sentence "However, unlike โ†ช๏ธ, it will execute that alternative expressions only if the โ†ช๏ธ expression is ๐Ÿ‘" doesn't make much sense: both โ†ช๏ธ and ๐Ÿ™…โ†ช๏ธ execute a block if the associated expression is ๐Ÿ‘. (Additionally, "that" and "expressions" disagree in grammatical case; it should either be "that alternative expression" singular or "those alternative expressions" plural, though maybe it should actually be talking about an "alternative block"?) Perhaps this should be reworded to say that ๐Ÿ™…โ†ช๏ธ evaluates its expression if no previous ๐Ÿ™…โ†ช๏ธ or โ†ช๏ธ in the sequence evaluated to ๐Ÿ‘.
  4. The Markdown-generated header tags have an id attribute based on the section title. Emoji in that title are replaced with -. This results in multiple HTML elements with the same id when a section header doesn't have any ASCII text. This makes fragment links to that section impossible. For example, <h3 id="-">๐Ÿ™…</h3> and <h3 id="-">๐Ÿ™…โ†ช๏ธ</h3> conflict for the fragment in https://www.emojicode.org/docs/reference/controlflow.html#-
  5. The comments in the code example for โฉ ranges don't properly explain the use of step. The first comment says "Prints numbers 0 through 8 (including)" but it actually only prints the even numbers (0 2 4 6 8). The 100 -10 -10 example might be more illustrative if it were 100 -15 10 which would (a) help convey that the second argument is the end and the third is the step and (b) illustrate the surprising behavior when abs(end - start) is not a multiple of step (the range seems to go from start to end - step inclusive, rather than from start to end exclusive).

(Code observations based on Emojicode-1.0-beta.2-Darwin-x86_64.)

Missing code sample

The code sample demoing an initialization of a class is missing from the docs page here. The previous code sample, showing how to create a class, is shown instead.

image

Better description of Operators

In the documentation there is a list of operators

binary-operator โŸถ โž• | โž– | โž— | โœ–๏ธ | ๐Ÿ‘ | ๐Ÿค | โ—€๏ธ | โ–ถ๏ธ | โญ•๏ธ | ๐Ÿ’ข |
binary-operator โŸถ โŒ | ๐Ÿ‘ˆ | ๐Ÿ‘‰ | ๐Ÿšฎ | ๐Ÿ™Œ | ๐Ÿ˜œ | โ—€๏ธ ๐Ÿ™Œ | โ–ถ๏ธ ๐Ÿ™Œ

However which one's which, they vary in how obvious their operation is,

Could we have like a legend for at least And / Or / Equals / Doesn't Equal?

Incorrect Pig Latin Definition

One of the example programs is to convert English to Piglatin. I like this idea, but the definition of Pig Latin is actually incorrect.
According to Google ...formed from English by transferring the initial consonant or consonant cluster of each word to the end of the word...
Notice that it is the initial consonant or consonant cluster. The included definition is the Pig Latin word you just have to move the first letter of the English word to the end
The example tests are only words that start with a single consonant followed by a vowel.

Here is the link to relevant page in your docs. http://www.emojicode.org/docs/guides/compile-and-run.html

File Loading Example Code Compilation Error

I tried to use this example from the page about packages: https://www.emojicode.org/docs/reference/packages.html#importing-other-packages

๐Ÿ“ฆ files ๐Ÿ 

๐Ÿ ๐Ÿ‡
  ๐Ÿบ๐Ÿ†•๐Ÿ“„๐Ÿ“œ ๐Ÿ”คnovel.txt๐Ÿ”คโ—๏ธ โžก๏ธ readFile
๐Ÿ‰

but the compiler gives me this error:

2-1.emojic:4:22: ๐Ÿšจ error: Unexpected token RightProductionOperator.
  ๐Ÿบ๐Ÿ†•๐Ÿ“„๐Ÿ“œ ๐Ÿ”คnovel.txt๐Ÿ”คโ—๏ธ โžก๏ธ readFile
                     โฌ†๏ธ

Make the Docs more user-friendly

โญ๏ธ Proposed change

Make it possible to search and/or cross-reference the documentation.

๐Ÿค” Rationale

One of the most frustrating things for a new developer getting into Emojicode is when you are reading the docs and you see an emoji (or a bunch of emoji) that you don't know what it means, and the documentation doesn't have any explanation about it. I would love to be able to either:

  • Search for the emoji and see other places in the docs it's referenced or defined
  • Hover/click on an emoji to see a tooltip description or link to its definition

Luckily, I'm very stubborn and eventually figure it out, but it's a problem I've had soooo many times and I'm sure I'm not alone.

๐Ÿ•บ Additional remarks

It looks like Doxygen creates some search stuff by default, but it doesn't look like it's in use in the docs site. I imagine that this is because it doesn't really work or isn't useful? Could we tweak Doxygen to improve it and make it usable?

If we did want to do tooltips, we would likely need to create an index that maps emoji to a definition and do some post-processing on the Doxygen-generated docs to add the tooltips.

If we did want to do cross-referencing, we would likely need to create an index that maps emoji to a URL (with # to the id of the section) and do some post-processing on the Doxygen-generated docs to add the links.

emojicode.org doesn't have a favicon

Screenshot from 2021-12-18 13-53-34

When you have a lot of tabs up, the Emojicode documentation doesn't stand out very well. Perhaps we could use a recognizable icon such as the file extension (๐Ÿ‡)?

No documentation for ๐Ÿ“ถ

The documentation for ๐Ÿ“ถ directs the reader to the "Memory Management" page of the Language Guide and Reference. However, the latter does not mention ๐Ÿ“ถ. I suspect this is a case of linkrot.

Generics Example Compilation Error

I am trying to run an example from the generics documentation page: https://www.emojicode.org/docs/reference/generics.html

๐Ÿจ๐Ÿ”คaa๐Ÿ”ค ๐Ÿ”ค12345๐Ÿ”ค๐Ÿ† โžก๏ธ list
๐Ÿฐ list ๐Ÿš๐Ÿ”ก๐Ÿ† ๐Ÿ‡ a ๐Ÿ”ก โžก๏ธ ๐Ÿ”ก
  โ†ฉ๏ธ ๐Ÿ”ค๐Ÿงฒa๐Ÿงฒ!๐Ÿ”ค
๐Ÿ‰

Compiling gives me the error:

2-1.emojic:3:18: ๐Ÿšจ error: Unexpected token RightProductionOperator.
  ๐Ÿจ๐Ÿ”คaa๐Ÿ”ค ๐Ÿ”ค12345๐Ÿ”ค๐Ÿ† โžก๏ธ list
                 โฌ†๏ธ

I tried changing the ๐Ÿจ to ๐Ÿฟ after seeing this issue: #65 but then I get the error, which I'm unsure of how to fix:

2-1.emojic:4:10: ๐Ÿšจ error: Unexpected token Generic.
  ๐Ÿฐ list ๐Ÿš๐Ÿ”ก๐Ÿ† ๐Ÿ‡ a ๐Ÿ”ก โžก๏ธ ๐Ÿ”ก
         โฌ†๏ธ

The example with type inference:

  ๐Ÿฐ list ๐Ÿ‡ a ๐Ÿ”ก โžก๏ธ ๐Ÿ”ก
    โ†ฉ๏ธ ๐Ÿ”ค๐Ÿงฒa๐Ÿงฒ!๐Ÿ”ค
  ๐Ÿ‰

also gave me an Unexpected token BlockEnd but I think I was able to fix it by adding an โ—๏ธ.

Document the overflow behavior

I cannot find any information on what happens when the result of an arithmetic operation does not fit in the value range of an integer. Is it wrapping around, a panic, or perhaps nasal demons or other undefined behavior?

Example in documentation doesn't compile

The example below from this page doesn't compile. The list variable is missing a mutability crayon.

๐Ÿ ๐Ÿ‡
  ๐Ÿจ ๐Ÿ”คHey!๐Ÿ”ค ๐Ÿ”คHi!๐Ÿ”ค ๐Ÿ”คHowdy!๐Ÿ”ค ๐Ÿ”คAloha!๐Ÿ”ค ๐Ÿ† โžก๏ธ list
  ๐Ÿน listโ—๏ธ
  ๐Ÿ˜€ ๐Ÿฝlist 0โ—๏ธโ—๏ธ
๐Ÿ‰

Compiler crash

While compiling the "Howdy Partner" example from the main site, I received the

The compiler crashed due to an internal problem: std::bad_alloc

message.

I am using Ubuntu for Windows 10 to compile.

While compiling, my computer slowed down considerably -- almost as if frozen.

Operators Aren't Fully Defined

The operators section of the language guide should explain the semantics of each operator for basic types. It's implied that โž—, โœ–๏ธ, โž–, โž• are the standard arithmetic operators. ๐Ÿค and ๐Ÿ‘ are explained as logical and and or. ๐Ÿ˜œ is defined as the identity check operator and says to use ๐Ÿ˜› for value equality, but ๐Ÿ˜› is not part of the BNF for binary-operator at the top of the page, nor in the operator precedence list. The remaining 11 operators in the binary-operator declaration are not explained.

The operators with highest precedence (๐Ÿ”ฒ, โฌ›, ๐Ÿ”บ, โ‰๏ธ, ๐Ÿบ) are not part of the BNF for binary-operator and I have absolutely no clue what they might mean as operators.

The Operator Precedence section says "Operators at top are evaluated first" but does not specify how operators with the same precedence are handled. (One might guess that they're left-associative, but this should be stated explicitly.)

Confusing sentence in section on Optionals in ref manual

You wrote:

The point of Optionals is providing more safety. This is achieved by forcing the programmer to take
special care of optionals as optionals cannot be used like the they make optionals.

I tried to fix it in a PR, but couldn't actually figure out what you mean by "as optionals cannot be used like the they make optionals."

Syntax Page: start-flag not defined in previous chapter

The description of start-flag in https://www.emojicode.org/docs/reference/syntax.html says

start-flag was already described in the previous chapter. All other rules will be explained in detail later on.

The Syntax page is the second one in the Language Reference and Guide, and the first page doesn't say anything about start-flag, so this reference is confusing.

The document should link to the documentation of ๐Ÿ directly (https://www.emojicode.org/docs/reference/basics.html#the-block) rather than by navigation relative navigation.

How to do modulo operations?

I might be blind, but even after looking through the documentation a few times, I haven't encountered any modulo operation examples. I've seen that the compiler uses 0x25 for this, but I have no idea what to do with this knowledge.

Also, you have perhaps done this on purpose, but it would be a bit easier (for me, at least) to find what I'm looking for, had the documentation used more common keywords like "for loops" or "if statements". Even though this might not be entirely correct for some reason, I find knowing what to search for incredibly hard.

Nice work, anyways. Keep it up!

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.