How To Make My Own Computer Code From Scrach.


Recommended Posts

Help! I don’t want a step by step instructions for this (not like you would give one to me) but I’m trying to make my own programming language so that if you type my new script on a html file it will recognize my command and do it (like Java, Html or C++) all I need is some vague idea how I would rite the code so my new program, "LutetiumScript", will work. And I will do the rest.

Thanks....

Link to post
Share on other sites

I tryd to enter the original post "How To Make My Own Computer Code From Scratch." But for some reason it wont let me.

to answer the last post on the subject.

LutetiumScript is a alternative scripting language to JavaScript that I’m trying to program but I don’t know the script to do so could you give me some vague idea how to make it. (no step by step stuff because that’s not real programming if I have some one spoon feed it to me)

Yes, Lutetium Script IS usually embedded directly into HTML pages.

Please help

Link to post
Share on other sites

Are you trying to implement your own programming language. First it's not something you can really do, if you could do this it wouldn't be much good unless other computer could use it. Your best bet would be to learn a already established scripting language. JavaScript would be a good start.

Link to post
Share on other sites

Creating a programming/scripting language is not something that any kiddie could hack up on his own. It take a lot of skill and knowledge. Things that teams of developers have to take into consideration included (but certainly not limited to):

* Compiler structure

* Lexical analysis (including regular expressions and finite automata)

* Syntax analysis (including context-free grammars, LL parsers, bottom-up parsers, and LR parsers)

* Syntax directed translation

* Type checking (including type conversions and polymorphism)

* Run-time environment (including parameter passing, symbol tables, and storage allocation)

* Code generation (including intermediate code generation)

* Code optimization

(again, I wasn't sure if you were looking for scripting or programming details)

Since you want to just throw it into HTML files, you also are expecting browsers to natively be able to understand and parse it. Sorry, but that won't happen. Languages like JavaScript are so mainstream that most browsers are told how to understand them by their developers. Good luck convincing Microsoft and Mozilla to embed an interpreter for anything you'd make.

Your best bet is to become familiar with an already-established language.

Link to post
Share on other sites

The first thing you need to do is get a feel for the language. If you haven't already, try writing a few short programs (a few dozen to a few hundred lines) and executing them by hand. Variety is good.

Then try sketching a grammar in EBNF and an operational semantics. Defining the semantics in terms of an abstract machine would give you an outline of an interpreter for free. If you planning to compile to another language -- say, JavaScript -- or existing an interpreter then you can just adopt the semantics of the target. In fact, if you're compiling to JavaScript you might be able to get away with a straightforward source-to-source transformation. JS is surprisingly flexible.

The actual implementation strategy depends on the the language and its purpose. You'll have a compiler, or at least a compiler front-end, no matter what you're doing, but beyond that....

Language design and implementation are more complicated, boring, and frustrating than hard, in my limited experience. But I tend to find everything to do with syntax complicated, boring, and frustrating, so YMMV.

(This post was just an excuse for the WP links. Note that there's a Wikibook on compiler construction.)

Edited by jcl
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...