Python Forum
how to make my programming language run as itself
Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to make my programming language run as itself
#1
currently,my programming language compiler(codime) is made using python ,so it needs python to run,
so how do i make my programming language compiler run as itself to compile .codime programming language
Reply
#2
I'm confused. You built a compiler in an interpreted language? What does it compile to?
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply
#3
sorry for such confusing question,i will try to break it down.
1)i am creating a programming language named codime.
2)i created codime compiler using python lexer and parser.
3)Because it is created using python,it needs python to run.
4)how do i make the compiler run without python(make the codime compiler run with codime(itself) instead of python)
Reply
#4
Are you sure it's not an interpreter? If it compiles, what does it compile to? (Python is interpreted, but compiles to bytecode, whereas in college we wrote a Lisp interpreter in Java, which doesn't create intermediate bytecode).

In any case, you should look into bootstrapping, but I'm not sure your goal is necessarily achievable without compromises and caveats.
Reply
#5
I'm still not quite sure what your doing. You could look into something like py2exe, but I think a better bet would be to use the Python code as a basis to rewrite the compiler/interpreter in a compiled language like C++. This is a not uncommon development cycle.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply
#6
Yes,bootstrapping is what I am looking for,thanks.
But,how is it done,tutorial please?
Reply
#7
(Dec-21-2016, 04:02 AM)hsunteik Wrote: tutorial please?
The reason you've been asked repeatedly what you're compiling to is that we're really skeptical you've written a compiler. I suspect you've written an interpreter. You can't bootstrap an interpreter, because the whole idea with this particular kind of bootstrapping is to use the previously compiled binary, but if you're not producing a binary, you can't bootstrap.

So, if you want a better answer than that, you must answer this question: What are you compiling to?
Reply
#8
I am following this tutorial series by howcode:
https://m.youtube.com/watch?v=pWAxiKdJF0c

The tutorial is about recreating basic with Python,but instead of basic ,I am creating a entirely new programming language.


Sorry,I don't know how to answer your question because me myself don't know.

may be the video above can answer the question?
Reply
#9
You've written an interpreter. The guy in the tutorial repeatedly refers to it as an interpreter.

What you could do, as I had suggested, is to redo your interpreter in a compiled language like C++ or Rust. Then you would get an .exe of your interpreter, and you could pass you codime program to the .exe to be interpreted. Then people wouldn't need Python, although they would need the .exe file.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply
#10
Can I make it using python and then convert it to. exe using some software (py2exe)or method(using iexpress in window) or
Is it a must to make the interpreter in a compiled language.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Inconsistency in Python programming language? newbieAuggie2019 31 11,402 Oct-06-2019, 03:21 PM
Last Post: adt
  Terms describing Python Programming language leodavinci1990 3 2,721 Aug-12-2019, 02:48 PM
Last Post: leodavinci1990
  Please help a newbie choose which programming language to learn. yeto 2 3,498 Feb-25-2019, 12:56 AM
Last Post: yeto
  How to make the python default language be 3.6 instead of 2.7 sylas 4 6,825 Jul-06-2018, 06:11 AM
Last Post: sylas

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020