Git Product home page Git Product logo

arnoldc's People

Contributors

antonkapyshin avatar cdagraca avatar drdub avatar eurafa avatar kylestev avatar lhartikk avatar loadingpleasewait avatar rootmeanclaire avatar vasiliybondarenko avatar xbony2 avatar zsiciarz 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  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

arnoldc's Issues

Punctuation marks in keywords and phonetic affinity

I believe we should allow both punctuation marks in keywords, and phonetic affinity (e.g. IT'S NOT A TOOMAH! over IT'S NOT A TUMOR! over IT'S NOT A TUMOR) as they correspond beautifully with ADD, which has been adopted as a fundamental guideline.

My vote goes for both.

People, cast your votes.

Syntax suggestions

Red Heat:
malloc: CAPITALISM

Predator:
free: YOU ARE ONE UGLY MOTHERFUCKER

Terminator:
exit: CHILL OUT DICKWAD

Getting Error on compiling it in console

C:\Windows\system32>java -jar ArnoldC.jar hello.arnoldc

Error:Exception in thread "main" org.parboiled.errors.ParsingException: WHAT THE FUCK
DID I DO WRONG:
Invalid input '-', expected Root (line 1, pos 1):
-e "IT'S SHOWTIME\nTALK TO THE HAND "hello world"\nYOU HAVE BEEN TERMINATED"
^

    at org.arnoldc.ArnoldParser.parse(ArnoldParser.scala:191)
    at org.arnoldc.ArnoldGenerator.generate(ArnoldGenerator.scala:8)
    at org.arnoldc.ArnoldC$.main(ArnoldC.scala:20)
    at org.arnoldc.ArnoldC.main(ArnoldC.scala)

What did I miss doing?

Missing keywords

Awesome job guys, this stuff is hilarious!

I noticed a few keywords missing though. Here are my humble suggestions:

break: "If it bleeds we can kill it"
modulo (%): "I let him go"
null: "You're one ugly muthafucka"
static: "Stick around" (if you implement object oriented code)

Implement sleep

It would be perhaps useful to have an ability to sleep for a period of seconds. Something like:

(DON'T DISTURB MY FRIEND) HE'S DEAD TIRED

Possibility to add comments in the code

For instance:

hash stands for comment

begin

IT'S SHOWTIME

print greeting

TALK TO THE HAND "hello world"

end main

YOU HAVE BEEN TERMINATED

or something more "arnold specific"

Deprecating "GET UP" due to severe violation of ADD

I suggest we deprecate GET UP and go with GIVE YOU A LIFT

Personally I don't think we're at a stage where breaking changes are automatically veto'd. Push comes to shove, we can maintain backward compatibility by keeping both.

Users who believe this change will cause their production systems an unacceptable time, please speak now.

Ability to run sources directly from ArnoldC

It would be good to have an ability to compile and execute ArnoldC source directly with one command. It can be look like the following:

java -jar ArnoldC.jar -run hello.arnoldc

and compile source with the following command:

java -jar ArnoldC.jar -compile hello.arnoldc

instead of

java -jar ArnoldC.jar hello.arnoldc
java hello

Why no C macros?

Could ArnoldC be expressed as C macros, or is the Scala doing something more sophisticated?

String type

It will be nice to see the String type and also some corresponding operations, such as concatenation of strings with each other.

Arnold Driven Development vs. Feature Driven Development

I think there are currently two "schools"

Arnold Driven Development (ADD)

  • Focuses on adding the "missing" one liners people are craving for (especially from Kindergarten Cop)
  • Doesn't really matter if the commands are usefully

Feature Driven Development (FDD)

  • Develop useful features so that you could actually do something with the language e.g. solve Euler#1, read input etc.

Discuss!

Divide by zero isn't handled properly

Consider the following contrived example:

IT'S SHOWTIME
HEY CHRISTMAS TREE var
YOU SET US UP @I LIED
GET TO THE CHOPPER var
HERE IS MY INVITATION 1
HE HAD TO SPLIT 0
ENOUGH TALK
TALK TO THE HAND var
YOU HAVE BEEN TERMINATED

I get:

Exception in thread "main" java.lang.ArithmeticException: / by zero
    at hello.main(Hello.java)

I would expect something like:

HERE'S YOUR SUBZERO, NOW PLAIN ZERO

Logical Not

To be able to do all logical functions a not function is needed.

I might suggest:
NOT TO BE

Random

As of yet, ArnoldC has no method for generating random numbers.

Tavi Rider on reddit suggested I WAS ELECTED TO LEAD NOT TO READ

Inconsistent stack map frames

I tried to write a recursive factorial function, the compiler did not complain, but when i tried to run it, jvm threw an exception when loading the class file

Exception in thread "main" java.lang.VerifyError: Inconsistent stackmap frames at branch target 39 in method fact.fact(I)I at offset 16
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2521)
at java.lang.Class.getMethod0(Class.java:2764)
at java.lang.Class.getMethod(Class.java:1653)
at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:494)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:486)

and here's the source of the factorial method & main:
IT'S SHOWTIME
HEY CHRISTMAS TREE f
YOU SET US UP 1
GET YOUR ASS TO MARS f
DO IT NOW fact 5
TALK TO THE HAND f
YOU HAVE BEEN TERMINATED

LISTEN TO ME VERY CAREFULLY fact
I NEED YOUR CLOTHES YOUR BOOTS AND YOUR MOTORCYCLE n
GIVE THESE PEOPLE AIR
    HEY CHRISTMAS TREE m
        YOU SET US UP 1
    HEY CHRISTMAS TREE f
        YOU SET US UP 1

    BECAUSE I'M GOING TO SAY PLEASE n
        I'LL BE BACK 1
    BULLSHIT
        GET TO THE CHOPPER m
            HERE IS MY INVITATION n
            GET DOWN 1
        ENOUGH TALK
        GET YOUR ASS TO MARS f
        DO IT NOW fact m
        GET TO THE CHOPPER f
            HERE IS MY INVITATION f
            YOU'RE FIRED n
        ENOUGH TALK
        I'LL BE BACK f
    YOU HAVE NO RESPECT FOR LOGIC
HASTA LA VISTA, BABY

Add try/catch statements?

There are certain cases where a try/catch statement would allow more sophisticated behaviors. Arnold would be quite pleased with more powerful programs, so we should consider this proposal seriously. My thoughts:

try: I LET HIM GO
catch: IT'S NOT A TUMOR

No 99-bottles-of-beer?

Hi guys, I guess this is not a real issue and therefore this might not be the best way to reach you, but it's the easiest one I found.

I stumbled upon your programming language and found it very fun and hilarious, I strongly encourage you to check out this website which is a hub for "esoteric" programming languages, like yours:

http://99-bottles-of-beer.net/

Basically you just have to write a program that sings the famous song and place it there, so everyone can know about your language and see it in action :-)

Cheers!

Stateless symboltable

In current implementation the mutable symboltable is passed in code-generation phase from the AST nodes and updated accordingly.
--> CHANGE TO
Symboltable to immutable. Each AST node resolves it's variables/symbols which can then be passed upwards.

Inconsistent stackmap frames errors

I love ArnoldC and have been experimenting with it for a bit, but I have come across several scenarios where I have tried to run my program and got lengthy errors regarding inconsistent stackmap frames.

For example,
Exception in thread "main" java.lang.VerifyError: Inconsistent stackmap frames at branch target 75
Exception Details:
Location:
lfib.main([Ljava/lang/String;)V @75: return
Reason:
Type top (current frame, locals[5]) is not assignable to integer (stack map, locals[5])
Current Frame:
bci: @23
flags: { }
locals: { integer, integer, integer, integer, integer }
stack: { integer }
Stackmap Frame:
bci: @75
flags: { }
locals: { integer, integer, integer, integer, integer, integer }
stack: { }
Bytecode:
0000000: 1100 193b 1100 003c 1100 003d 1100 013e
0000010: 1100 0136 0415 0499 0034 1100 0036 051c
0000020: 1d60 3605 b200 1115 05b6 0017 1d3d 1505
0000030: 3e1b 3c1a 1ba3 0007 03a7 0007 04a7 0003
0000040: 3604 1b11 0001 603c a7ff cdb1
Stackmap Table:
full_frame(@21,{Integer,Integer,Integer,Integer,Integer},{})
full_frame(@60,{Integer,Integer,Integer,Integer,Integer,Integer},{})
same_locals_1_stack_item_frame(@64,Integer)
same_frame(@75)

at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2531)
at java.lang.Class.getMethod0(Class.java:2774)
at java.lang.Class.getMethod(Class.java:1663)
at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:494)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:486)

Code causing this error: https://gist.github.com/brandonio21/be36c230748e6d530027#file-lfib25

Default compiler functionality to compile+run

Current functionality:
An ArnoldC program is given as an input to the compiler. Java Bytecode is generated. The generated Java Bytecode has to be run with a second command.

Desired functionality:
The default functionality compiles and runs the program. Additional flags can be given if only the Bytecode is desired.

Logical operations break use of previously defined variables

Attempting an assignment using logical operations (including CONSIDER THAT A DIVORCE, KNOCK KNOCK, and YOU ARE NOT YOU YOU ARE ME) breaks use of variables defined before the assignment. Compiles fine, byte code is broken.

Minimal reproducing code:

IT'S SHOWTIME

HEY CHRISTMAS TREE one
YOU SET US UP 0

HEY CHRISTMAS TREE two
YOU SET US UP @I LIED

GET TO THE CHOPPER two
HERE IS MY INVITATION @I LIED
YOU ARE NOT YOU YOU ARE ME @I LIED
ENOUGH TALK

TALK TO THE HAND one

YOU HAVE BEEN TERMINATED

Author is not friends with me

This is the best thing I have ever seen.

I wanted to send you an email saying so, but it looks like you don't post it on your profile (understandable). As you can probably tell from my profile, I work at Uber and think we need more people like you who write code like this.

Even if you're not looking to get recruited, you should come by the office and get a beer sometime. The world owes it to you for this.

Feature: read input

I don't see any mechanism to read input (from file, console, anything), would be cool to have

Accepting a few arguments by Print

It would be nice to have an ability to pass a few arguments to Print to concatenate them like the following:
TALK TO THE HAND "F( " n ")=" m

Improving the compiler output in erroneous situations

Current situation:
The compiler outputs the default Parboiled error messages about expected input when something unexpected input is countered.
Desired situation:
-Giving more semantic meaning to the error messages
-Did you mean messages to help the user:
e.g. the user types ITS SHOWTIME ->did you mean IT'S SHOWTIME

Building the package for newbies

Hello,

I'm new to the whole scala/JVM stuff but I managed to create a JAR file following the instructions from here: http://www.scala-sbt.org/release/docs/Getting-Started/Welcome.html . However I'm still having trouble getting the compiler to run (on Ubuntu 13.10).

I installed scala

# apt-get install scala

installed sbt from the deb source above
and in the project folder I ran

# sbt
> compile
> package

now I have a JAR file but when I try to run I get an exception:

misel@miles:~/code/ArnoldC$ java -jar target/scala-2.10/arnoldc_2.10-0.1.jar hello.arnoldc
Exception in thread "main" java.lang.NoClassDefFoundError: scala/io/Source$
        at org.arnoldc.ArnoldC$.main(ArnoldC.scala:12)
        at org.arnoldc.ArnoldC.main(ArnoldC.scala)
Caused by: java.lang.ClassNotFoundException: scala.io.Source$

Do you have any ideas what's the problem might be?

And maybe a guide like this might be helpful in the README.md :)

Regards,
Stefan

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.