[SOLVED] Creating new programming languange. Help needed!
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
What's the end goal of this exercise? To take an existing code, remove comments, and change variable and function names to make it difficult to interpret?
It sounds like you maybe want an obfuscation tool?
There are plenty of ready-made obfuscation programs out there, just do a Google search.
A search for "python obfuscation" returns pyminifier, bitboost, and mnfy all on the first page. There are obfuscation programs for almost any language out there, you just need to search.
class Quitter(Frame):
def __init__(self, parent=None):
Frame.__init__(self, parent)
self.pack()
widget = Button(self, text='Quit', command=self.quit)
widget.pack(expand=YES, fill=BOTH, side=LEFT)
def quit(self):
ans = askokcancel('Verify exit', "Really quit?")
if ans: Frame.quit(self)
So insted of writing that code you can just write m.
Not a Python person, but isn't this just the definition of a MACRO?
That's what I'm thinking you'd create enumerations and macros in C in one or more include files and then you'd have to #include that H file. Once you have it, you then can use your macros, declarations, and type defines. In fact, that's done in many architectures. For instance, variable types, people figure out what the size of an int and long are and then they do type defines to make uint8_t, uint16_t, uint32_t, and the signed equivalents.
This is all that you're wanting to do. And you can do that probably in any language. I know you can do this in C, C++, C#, Java, even Assembler, so I'd imagine that this is possible in Tcl, Python, very many other languages.
But I think you'd have to structure these macros differently so that the macro would adhere to the rules of the language, but then still be the same interface to the higher level user invoking it.
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680
Rep:
Why do you want to obfuscate the code? Wouldn't compiling it then running it through a decompiler give you suitably unreadable code? If not, then why bother anyhow?
Not only that code needs to be unreadable it needs to be short (short like one symbol m,n,2,/,|...) and code needs to be possible to be copyed or writen in its shortened version.It needs to be compatible with any language.So I gues it needs to be language for itself.
Like I said Im a noob in programming but this is how I imagine compatibility of languanges.
our code is symbol Đ I gues there is no language with that symbol cuz of that I assume its compatible with other languages so dosent interfer with any other symbols of that languages
Not only that code needs to be unreadable it needs to be short (short like one symbol m,n,2,/,|...) and code needs to be possible to be copyed or writen in its shortened version.It needs to be compatible with any language.So I gues it needs to be language for itself.
Like I said Im a noob in programming but this is how I imagine compatibility of languanges
Pointless.
Unreadable code.
Why bother? Just to be "cool"?
Yes you are new to coding because one of the primary directives of a coder is to make readable, maintainable code.
As others are saying, obfuscation is not the right choice here.
And I've already pointed out that you can obfuscate in C already, but the intentions are not that you write code to as abstract what it really is doing and thus making it unreadable and non-maintainable.
What does one gain with compatibility of languages? What about portability instead?
Its my language so I its readable and maintainable by me. In this case we dont need portability we need compatibility.
Question about obfuscation: We have 2 identical programms made by same language in 1st programm we obfuscate all codes of programm with some kind of obfuscation tool. So can we now copy that obfuscated code from 1st programm to 2nd programm or we must use obfuscation tool on that 2nd programm too??
It seems that only solution is creating part of custom programming language ie. one function.
And that functions result should be eg. 2+3=5 and our code loks like letter m
So when we are programming and we write m it will print 2+3=5
Not only that code needs to be unreadable it needs to be short (short like one symbol m,n,2,/,|...) and code needs to be possible to be copyed or writen in its shortened version.
WHY?
You still haven't answered this very basic question.
What are you doing? What is the end goal? What is driving these requirements you keep posting?
Quote:
Originally Posted by lolada6
It needs to be compatible with any language.
WHAT needs to be compatible?
Are you inventing a language with which you can write programs, or a tool you can use to shorten the syntax and obfuscate existing programs in other languages, or a tool where you can write "pseudocode" and it will auto-generate code in a language you select???
Let me ask you this. When this exercise of yours is done, when you've hit that point where you pop the cork and have a drink because the work is over, what does the end result look like? What is it? What does it do? How do you use it? What do you use it for?
Quote:
Originally Posted by lolada6
It seems that only solution is creating part of custom programming language ie. one function.
And that functions result should be eg. 2+3=5 and our code loks like letter m
So when we are programming and we write m it will print 2+3=5
Any ideas for how to do that?
Look back at page 1. This thread has gone full circle.
Last edited by suicidaleggroll; 06-18-2015 at 10:05 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.