User Controls

Creating a programming language.

  1. #1
    Sophie Pedophile Tech Support
    Sup guys. So i've been thinking for a while now, how awesome and convenient it would be to have a shell/terminal emulator compatible with all major platforms, complete with it's own shell scripting language, built-in tools and utilities and basically everything you'd expect a modern shell/terminal to have, it would come shipped with all it's dependencies maybe as a PE or with an installer for windows, but i'd prefer it to be fully self contained.

    What i also want to do is write a simple IDE to be used with the shell scripting language. Now i know how to write the utilities i envision and i plan on writing the IDE and terminal part of the program in NodeJS and Electron. The issue is however that in order for this to work i will need to write an interpreter as well, which i really don't have any experience with obviously i need to write something that is able to read in the shell scripting language translate it to something that i can make system calls with and somehow have the interpreter understand logic operators as well.

    With regards to programming i am the most proficient in Python, and yeah i know, making an interpreter with an interpreted language is about as inefficient as you can be. But i would at least like to make a prototype in this way.

    I've been getting better at the .NET languages(.NET Core mainly since it is cross platform), so the final version of the interpreter might be in C# or F# but right now i don't think i could pull it off, that said, i really think this would be a cool project to work on and even if the finished product is a tad slow, it would still be great especially as a PE, where you just take your shell/term with you and no matter where you go or on what platform you are you got your favorite shell right there.

    In any case i was wondering if you could tell me a little on how to go about the process of designing a shell scripting language and maybe point me in the right direction to get started on an interpreter for that language.

    Thanks guys.
  2. #2
    Admin African Astronaut
    I know you've talked about this before.

    Wouldn't this all be dependent on the OS supporting the language? Maybe good for personal use but seems like reinventing the wheel.
  3. #3
    filtration Houston
    Originally posted by Admin Wouldn't this all be dependent on the OS supporting the language? Maybe good for personal use but seems like reinventing the wheel.

    A computer can support any language... The language has to support the computer. OP will need to look at the APIS for different operating systems to do it.


    i plan on writing the IDE and terminal part of the program in NodeJS and Electron

    Please don't. While they have their uses, a terminal/IDE isn't one. It'll be a ram hog. I suggest you write it in c# and you can use winforms for windows. gtk for linux and w/e the one for mac is.


    In any case i was wondering if you could tell me a little on how to go about the process of designing a shell scripting language and maybe point me in the right direction to get started on an interpreter for that language.

    Create adapters for the different apis, for example (c#)


    windows


    namespace yaddayaddda;

    class WinAPI
    {
    public bool hasWritePerms()
    {
    // code specifically for windows, to check
    }
    }


    linux


    namespace yaddayaddda;

    class LinuxApi
    {
    public bool hasWritePerms()
    {
    // code specifically for linux, to check
    }
    }


    then your logic can be the same, you just access the adapters


    Regarding the lexer and shit, sorry, I dove in to it when we spoke about it, and I have ADD, and couldn't/didn't process shit.
    The following users say it would be alright if the author of this post didn't die in a fire!
  4. #4
    Lanny creature of the mesothelioma era


    Language design is one of those things I've been pretty interested in for a while but haven't ever found a compelling project to really use it for and god knows no one is going to pay me for it. I started a much longer reply but don't have time to finish it at the moment.

    The basic pipeline for an interpreter is lex -> parse -> evaluation. Here's some high level stuff on each stage:

    https://en.wikipedia.org/wiki/Lexical_analysis
    https://en.wikipedia.org/wiki/LL_parser
    http://wiki.c2.com/?EvalApply

    LL parsers aren't the only parsers but they're the most common ones that can be well implemented. And eval/apply is the only execution strategy for interpreted languages but it's one of the easier ones to understand and implement (although it is still kind of magical).

    Hopefully will be back with more deets hopefully that's some reading to get started with, happy to answer more specific questions.
    The following users say it would be alright if the author of this post didn't die in a fire!
  5. #5
    6011UM Tuskegee Airman
    SOUNDS GAY
  6. #6
    Originally posted by Lanny

    is that animal fur or synthetic ?
  7. #7
    Lanny creature of the mesothelioma era
    My hair is real, thank you very much
  8. #8
    Originally posted by Lanny My hair is real, thank you very much

    you will look gorgeous with long hairs.
    The following users say it would be alright if the author of this post didn't die in a fire!
  9. #9
    6011UM Tuskegee Airman
    Lanny looks like this guy who used to blow me for weed
  10. #10
    Admin African Astronaut
    Originally posted by filtration A computer can support any language… The language has to support the computer. OP will need to look at the APIS for different operating systems to do it.

    A computer can but I think if he makes a language for an OS his programs will only run on his own machine. Or can they just be compiled into machine code?

    Originally posted by Lanny My hair is real, thank you very much

    Lucky.
  11. #11
    aldra JIDF Controlled Opposition
    Originally posted by Lanny

    ENHANCE

    The following users say it would be alright if the author of this post didn't die in a fire!
  12. #12
    6011UM Tuskegee Airman
    i need that book
  13. #13
    aldra JIDF Controlled Opposition
    no I think you've already excelled beyond what expertise it could provide you
    The following users say it would be alright if the author of this post didn't die in a fire!
  14. #14
    Lanny creature of the mesothelioma era
    using a python, now that's an advanced technique in both programming and gay sex
    The following users say it would be alright if the author of this post didn't die in a fire!
  15. #15
    6011UM Tuskegee Airman
    Originally posted by aldra no I think you've already excelled beyond what expertise it could provide you

    i disagree I've never been fucked by a sexy snake before

    but im a fast learner
  16. #16
    seventwo Yung Blood
    There's too much to support to capture everything. If you're looking into lexers and parsers, the canonical literature seems to always be the dragon book, but most people never read it. Start with a domain specific language and build from there. A good introduction: https://www.youtube.com/watch?v=zJ9z6Ge-vXs
    The following users say it would be alright if the author of this post didn't die in a fire!
  17. #17
    Sophie Pedophile Tech Support
    Bump for myself. Good thread Sophie from the past you always have the greatest ideas. Let me delve into my digital library to see if i have "The Dragon Book" it's not my library it's more of a shared thing on a hidden service but that's beside the point. We should have a NiS book repository for excellence in computer science.

    That said, didn't i send you like a gig of PDFs once Lonnie? Also lex -> parse, got it. Whether people usually read teh canonical resources or not is irrelevant, i learned to code with books, and the internet and a shitty text editor so that should be fine.

    Also @Filtration, i appreciate the point you're making and i appreciate your input on .NET but Node and Electron are easy and the first iteration will not be "Production" as it were. Also, no OSS until i got something good. That said, while i will be reading the relevant literature i will also just be fucking around with Node and Python because i enjoy that, so you know.
Jump to Top