Shakespeare, esotherische Programmiersprache



  • Der Tip von rkhb mit sudo ist Blödsinn. sudo cd bringt gar nix. Einfach nur cd ohne sudo. Genauso, wie ich es geschrieben habe.



  • LordJaxom schrieb:

    Also Du musst Dir auch schon selbst noch ein bisschen Mühe geben! Wenn man etwas PC-affin ist, bekommt man vieles eigentlich auch durch Probieren raus.

    Programmierer werd ich trotzdem nicht 😃 Und wenn das tatsächlich einer der am schwersten erlernbaren Programmiersprachen ist dann ists ja perfekt 😃 Flash, Processing etc. sind wenigstens übersichtlich, aber sowas übers Terminal zu installieren hab ich ja auch noch nie gemacht 😞 Würds ja gern verstehen, aber das is echt komplex...

    LordJaxom schrieb:

    snickers_90 schrieb:

    2. Was genau ist spl2c? 😕

    Der Shakespeare-Compiler, über den wir seit vier Seiten reden. Der, den Du bereits erfolgreich installiert haben solltest...

    Ja gut, das war ja das mit dem "get install shakespeare" wo es auch schon Probleme gab...



  • snickers_90 schrieb:

    Und wenn das tatsächlich einer der am schwersten erlernbaren Programmiersprachen ist dann ists ja perfekt 😃

    Bisher machst du ja noch gar nichts in dieser Programmiersprache, das bisher wäre für Java oder Ruby praktisch genauso gewesen.



  • cooky451 schrieb:

    Ach vergiss das mit dem find, blöder Tipp

    nman schrieb:

    Der Tip von rkhb mit sudo ist Blödsin

    Also, dann verabschiede ich mich mal aus dem Thread, das muss ich mir nicht antun. Bei mir ist Shakespeare jetzt installiert und funktioniert.

    viele grüße
    ralph



  • Also, du hast das Terminal geöffnet. Dann gibst du folgendes in das Terminal ein:
    1. cd /Users/Manu/Desktop/spl-1.2.1/examples/ <ENTER>
    2. spl2c < hello.spl > hello.c <ENTER>
    3. gcc hello.c -lspl -o hello <ENTER>



  • pyhax schrieb:

    Also, du hast das Terminal geöffnet. Dann gibst du folgendes in das Terminal ein:
    1. cd /Users/Manu/Desktop/spl-1.2.1/examples/ <ENTER>
    2. spl2c < hello.spl > hello.c <ENTER>
    3. gcc hello.c -lspl -o hello <ENTER>

    Super 👍 Das würde an sich funktionieren, wenn ich nicht die Fehlermeldung bekommen würde, die schon mal jemand bekommen hat mit dem defekten Code. Das heißt dann wohl wie rkhb gemeint hat, ich muss diesen Fork installieren.

    rkhb schrieb:

    Man muss einen Fork installieren:

    http://stackoverflow.com/questions/1948372/compiling-and-executing-the-shakespeare-programming-language-translator-spl2c-on/4418284#4418284

    Was ist ein Fork und was macht dieser? Bzw. wie installiere ich ihn?
    An und für sich sollte es dann ja tun 🙂

    Das was bisher rauskommt sieht so aus:

    MacBP:~ Manu$ cd /Users/Manu/Desktop/spl-1.2.1/examples/
    MacBP:examples Manu$ spl2c < hello.spl > hello.c
    Warning at line 32: comment expected
    Warning at line 32: comment expected
    Warning at line 32: comment expected
    Warning at line 32: comment expected
    Warning at line 32: comment expected
    Warning at line 32: comment expected
    Warning at line 32: colon expected
    Warning at line 42: comment expected
    Warning at line 42: comment expected
    Warning at line 42: comment expected
    Warning at line 42: comment expected
    Warning at line 42: comment expected
    Warning at line 42: comment expected
    Warning at line 42: colon expected
    Warning at line 57: comment expected
    Warning at line 57: comment expected
    Warning at line 57: comment expected
    Warning at line 57: comment expected
    Warning at line 57: comment expected
    Warning at line 57: comment expected
    Warning at line 57: comment expected
    Warning at line 57: colon expected
    Warning at line 76: comment expected
    Warning at line 76: comment expected
    Warning at line 76: comment expected
    Warning at line 76: comment expected
    Warning at line 76: comment expected
    Warning at line 76: comment expected
    Warning at line 76: comment expected
    Warning at line 76: comment expected
    Warning at line 76: colon expected
    31 warnings found. Code may be defective.
    MacBP:examples Manu$
    


  • Das sind warnings. Das Programm sollte troztdem funktionieren. Teste es mal, in dem du folgendes eingibts:
    1. cd /Users/Manu/Desktop/spl-1.2.1/examples/ <ENTER>
    2. ./hello



  • Äh.. pyhax, du hast da den GCC Aufruf vercheckt. :p



  • cooky451 schrieb:

    Äh.. pyhax, du hast da den GCC Aufruf vercheckt. :p

    Oops, stimmt. Der muss noch vor das ./hello. 😃

    EDIT: Ich habe gerade selber Probleme, spl zu kompilieren 😮



  • Joa, geht wohl irgendwie über Macports, guck dir mal die Beiträge am Anfang an.



  • rkhb schrieb:

    Also, dann verabschiede ich mich mal aus dem Thread, das muss ich mir nicht antun. Bei mir ist Shakespeare jetzt installiert und funktioniert

    Ändert nichts daran, dass ein sudo cd /foo/bar/baz immer Blödsinn ist, der nichts bewirkt.

    Warum? Ganz einfach: Du wechselst als Superuser das Verzeichnis, gibst die Superuser-Rechte und das Working Directory aber sofort wieder auf und bist nach dem sudo wieder in exakt dem selben Verzeichnis wie vorher.



  • cooky451 schrieb:

    Joa, geht wohl irgendwie über Macports, guck dir mal die Beiträge am Anfang an.

    Ich habe keinen Mac, sondern Linux 😃



  • Ich versteh sowieso nicht, warum ihr euch immer allso so kompliziert macht. Einfach am Anfang sudo su machen und geht.



  • sudo su ist das sudo -i des armen Mannes.

    Dennoch ist es nicht sinnvoll, dauernd als root zu arbeiten, wenn nicht unbedingt nötig.



  • pyhax schrieb:

    Das sind warnings. Das Programm sollte troztdem funktionieren. Teste es mal, in dem du folgendes eingibts:
    1. cd /Users/Manu/Desktop/spl-1.2.1/examples/ <ENTER>
    2. ./hello

    Das sind mega Warnings 😮 aber es gibt mir das Gleiche aus 😞

    Ich kann zwar zum Ordner navigieren, aber die Fehler im SPL Code behebts mir nicht. Kann da nix öffnen 😞

    Wie soll das dann eigentlich aussehen? Also öffnet sich dann ein neues Fenster mit dem kompilieren SPL-Code?

    Habs gerade nochmal mit dem ./hello am Ende des gcc Befehls probiert...Da kommt dann nochmal ne andere Fehlermeldung vom SPL Code. Ich krieg ihn einfach nicht zum Laufen. " spl.h " liegt auf jeden Fall definitiv in diesem Verzeichnis, wird aber trotzdem nicht gefunden. 🙄 Ach ja: danke für den Tip mit " sudo -i ", das tut 🙂

    MacBP:examples root# gcc hello.c -lspl -o ./hello
    hello.c:7:17: error: spl.h: No such file or directory
    hello.c: In function ‘main’:
    hello.c:15: error: ‘CHARACTER’ undeclared (first use in this function)
    hello.c:15: error: (Each undeclared identifier is reported only once
    hello.c:15: error: for each function it appears in.)
    hello.c:15: error: ‘romeo’ undeclared (first use in this function)
    hello.c:16: error: ‘juliet’ undeclared (first use in this function)
    hello.c:17: error: ‘ophelia’ undeclared (first use in this function)
    hello.c:18: error: ‘hamlet’ undeclared (first use in this function)
    hello.c:37: error: ‘second_person’ undeclared (first use in this function)
    hello.c:49: error: duplicate label ‘act_i_scene_i’
    hello.c:31: error: previous definition of ‘act_i_scene_i’ was here
    hello.c:59: error: duplicate label ‘act_i_scene_i’
    hello.c:31: error: previous definition of ‘act_i_scene_i’ was here
    hello.c:73: error: duplicate label ‘act_i’
    hello.c:29: error: previous definition of ‘act_i’ was here
    hello.c:75: error: duplicate label ‘act_i_scene_i’
    hello.c:31: error: previous definition of ‘act_i_scene_i’ was here
    hello.c:93: error: duplicate label ‘act_i_scene_i’
    hello.c:31: error: previous definition of ‘act_i_scene_i’ was here
    MacBP:examples root#
    


  • Könnte es sein, dass in Zeile 7 der hello.c "#include <spl.h>" steht? Weil wenn es im gleichen Ordner ist, müsste da "#include "spl.h"" stehen. Könnte bedeuten, dass du nur noch die spl.h in das Verzeichnis kopieren musst, in dem er bei <> sucht. Allerdings weiß ich nicht, welches das unter Unix/GCC ist. Zudem: Das ./hello ist zum ausführen, das kommt doch nicht da hin!

    1. cd /Users/Manu/Desktop/spl-1.2.1/examples/ <ENTER>
    2. spl2c < hello.spl > hello.c <ENTER>
    3. gcc hello.c -lspl -o hello <ENTER>
    4. ./hello <ENTER>



  • cooky451 schrieb:

    Könnte es sein, dass in Zeile 7 der hello.c "#include <spl.h>" steht? Weil wenn es im gleichen Ordner ist, müsste da "#include "spl.h"" stehen. Könnte bedeuten, dass du nur noch die spl.h in das Verzeichnis kopieren musst, in dem er bei <> sucht. Allerdings weiß ich nicht, welches das unter Unix/GCC ist. Zudem: Das ./hello ist zum ausführen, das kommt doch nicht da hin!

    Also ich habs in der hello.c angepasst. Da steht jetzt "#include "spl.h"". Allerdings bekomm ich dennoch folgende Fehlermeldungen:

    Nach 2.: Das übliche mit "comment expected"

    31 warnings found. Code may be defective.
    

    Nach 3.: Und das obwohl ich die spl.h in den examples Ordner kopiert hab.

    hello.c:7:17: error: spl.h: No such file or directory
    hello.c: In function ‘main’:
    hello.c:15: error: ‘CHARACTER’ undeclared (first use in this function)
    hello.c:15: error: (Each undeclared identifier is reported only once
    hello.c:15: error: for each function it appears in.)
    hello.c:15: error: ‘romeo’ undeclared (first use in this function)
    hello.c:16: error: ‘juliet’ undeclared (first use in this function)
    hello.c:17: error: ‘ophelia’ undeclared (first use in this function)
    hello.c:18: error: ‘hamlet’ undeclared (first use in this function)
    hello.c:37: error: ‘second_person’ undeclared (first use in this function)
    hello.c:49: error: duplicate label ‘act_i_scene_i’
    hello.c:31: error: previous definition of ‘act_i_scene_i’ was here
    hello.c:59: error: duplicate label ‘act_i_scene_i’
    hello.c:31: error: previous definition of ‘act_i_scene_i’ was here
    hello.c:73: error: duplicate label ‘act_i’
    hello.c:29: error: previous definition of ‘act_i’ was here
    hello.c:75: error: duplicate label ‘act_i_scene_i’
    hello.c:31: error: previous definition of ‘act_i_scene_i’ was here
    hello.c:93: error: duplicate label ‘act_i_scene_i’
    hello.c:31: error: previous definition of ‘act_i_scene_i’ was here
    

    Nach 4.: Und das obwohl die hello.c in dem examples Ordner liegt.

    -bash: ./hello: No such file or directory
    

    Man man...zwei Wochen hab ich noch, dann muss es laufen 😃



  • Das bei 2. sind ja nur Warnungen, das muss nicht unbedingt etwas heißen. Bei 3. sind das aber Fehler, da geht's nicht weiter. Und natürlich wird deshalb auch kein Output produziert, den du mit 4. aufrufen könntest.
    Der erste Fehler ist aber immernoch "spl.h: No such file or directory". Kann gut sein, dass die ganzen Fehler danach darauf zurückzuführen sind. In der Zeile 7 der hello.c steht also

    #include "spl.h"
    

    und sowohl hello.c als auch spl.h sind im Ordner /Users/Manu/Desktop/spl-1.2.1/examples/?
    Dann verstehe ich nicht so ganz, warum er die Datei nicht findet. Bin etwas ratlos. Ich nutze GCC aber normalerweise auch nicht. Jemand anders eine Idee?



  • Das ganze hat mich jetzt interessiert. Unter OS X scheint SPL kaputt zu sein.
    Es gibt aber einen Fork der den Bug fixt:

    https://bitbucket.org/kcartmell/marlowe/downloads



  • Shade Of Mine schrieb:

    Das ganze hat mich jetzt interessiert. Unter OS X scheint SPL kaputt zu sein.
    Es gibt aber einen Fork der den Bug fixt:

    https://bitbucket.org/kcartmell/marlowe/downloads

    Und unter Linux ist es auch kaputt:

    ... Einige Warnings ...
    Error at line 90: 'act [roman number]' or 'scene [roman number]' expected
    

    Der angebliche Fix:

    gcc  grammar.tab.o scanner.o strutils.o -O2 -Wall -lfl -o spl2c
    grammar.tab.o: In function `report_warning':
    grammar.tab.c:(.text+0x8): undefined reference to `yylineno'
    grammar.tab.o: In function `report_error':
    grammar.tab.c:(.text+0x38): undefined reference to `yylineno'
    grammar.tab.o: In function `yyparse':
    grammar.tab.c:(.text+0x4d9): undefined reference to `yylex'
    grammar.tab.c:(.text+0x636): undefined reference to `yylineno'
    grammar.tab.c:(.text+0x6d0): undefined reference to `yylineno'
    grammar.tab.c:(.text+0x7b3): undefined reference to `yylineno'
    grammar.tab.c:(.text+0x880): undefined reference to `yylineno'
    grammar.tab.c:(.text+0x904): undefined reference to `yylineno'
    grammar.tab.o:grammar.tab.c:(.text+0x9d1): more undefined references to `yylineno' follow
    collect2: Fehler: ld gab 1 als Ende-Status zurück
    make: *** [spl2c] Fehler 1
    

    WTF?! 😕


Anmelden zum Antworten