Author Topic: Generalizing programming language patterns in CodeBlocks  (Read 72668 times)

ToApolytoXaos

  • Guest
Re: Generalizing programming language patterns in CodeBlocks
« Reply #15 on: November 06, 2013, 07:56:56 am »
I have been following this topic and frankly all I read is the same repetitive thing without an actual sample either in the form of pseudo or literal programming code.

If you want a generic natural language mechanim, you should see how Perl is implemented by a linguist (Larry Wall). It's a great example of a powerfully flexible language that does exactly what you have in mind I would say. Again, maybe I'm wrong.

Another great example would be Lua, yet another powerful scripting language (and old too; blimey, 20 years old already!), that can let you use it to create any kind of Domain Specific Language (DSL) with its amazing metatable and metamethod operations.

Now, don't take my word as the absolute way of doing things, just experiment with your ideas; but provide us something here so we can get a rough idea of what you need.

Offline beqroson

  • Multiple posting newcomer
  • *
  • Posts: 63
Re: Generalizing programming language patterns in CodeBlocks
« Reply #16 on: November 06, 2013, 01:02:40 pm »
I have been following this topic and frankly all I read is the same repetitive thing without an actual sample either in the form of pseudo or literal programming code.

If you want a generic natural language mechanim, you should see how Perl is implemented by a linguist (Larry Wall). It's a great example of a powerfully flexible language that does exactly what you have in mind I would say. Again, maybe I'm wrong.

Another great example would be Lua, yet another powerful scripting language (and old too; blimey, 20 years old already!), that can let you use it to create any kind of Domain Specific Language (DSL) with its amazing metatable and metamethod operations.

Now, don't take my word as the absolute way of doing things, just experiment with your ideas; but provide us something here so we can get a rough idea of what you need.


Yes, well, the discussion would be if the idea is desirable, and next if it is implementable. I hope to give you a showcase this evening. This will enable me also to dig into some code and my mind works better to figure out if it is good or not. Also it is a good way to visualize what I intend.

Offline beqroson

  • Multiple posting newcomer
  • *
  • Posts: 63
Re: Generalizing programming language patterns in CodeBlocks
« Reply #17 on: November 06, 2013, 03:59:41 pm »
If you want a generic natural language mechanim, you should see how Perl is implemented by a linguist (Larry Wall). It's a great example of a powerfully flexible language that does exactly what you have in mind I would say. Again, maybe I'm wrong.

Aha. No, I used the term natural language too casually. What I really meant was to be able to write code in your mother tongue. Not that the actual compiler will know anything specific about your mother tongue. My showcase is coming together as expected so far, so if I dont hit a major snag I can upload it relatively soon.

Hmm, actually I have no specific web space to upload it to and link. Is there any suitable place where I can upload a zip file between 50-150MB to link in this forum? I was planning to create a codeblocks project to use together with a compiled console application and hook it up in the codeblocks IDE.

Update: As usual there was a programming error which I thought was a compiler version error. So after some hours recompiling libs I realize that it was a bug. I will get back on this tomorrow. However, I have not much time tomorrow, so this is going to take a couple of days. At least I managed to update to GCC 4.8, wxwidgets 3.0-RC2 and some others.
« Last Edit: November 07, 2013, 02:23:40 am by beqroson »

Offline beqroson

  • Multiple posting newcomer
  • *
  • Posts: 63
Re: Generalizing programming language patterns in CodeBlocks
« Reply #18 on: November 09, 2013, 04:05:48 pm »
Now I have made a small showcase test. It is a Codeblocks project that you can open with instructions in the header file. The file can be retrieved from a site that is on www.fileconvoy.com that can store temporary files on the net. This is the first time I use the fileconvoy service, so if there is any problem, please report them to me in here. The file:

http://www.fileconvoy.com/dfl.php?id=gbd5fa2503222f2ef999409854738b3006fc813032

Update: This project will only be usable on Windows.
« Last Edit: November 09, 2013, 06:22:12 pm by beqroson »

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Generalizing programming language patterns in CodeBlocks
« Reply #19 on: November 09, 2013, 06:59:09 pm »
Why don't you (a) just explain what it is rather than have us download some random file from a web-site known for malware, or (b) share your code publicly using one of the many reputable source hosting sites: github, gitorious, launchpad, pastebin, sourceforge, berlios.

Offline beqroson

  • Multiple posting newcomer
  • *
  • Posts: 63
Re: Generalizing programming language patterns in CodeBlocks
« Reply #20 on: November 09, 2013, 07:38:11 pm »
Why don't you (a) just explain what it is rather than have us download some random file from a web-site known for malware, or (b) share your code publicly using one of the many reputable source hosting sites: github, gitorious, launchpad, pastebin, sourceforge, berlios.

a) Of course it could be malware. You dont know me and I dont know you.
b) Share the code? What in the code is interesting as it is neither finished nor advanced nor complete.
c) I may have picked the wrong sub-forum. I should have placed this discussion on the suggestion forum and moved up from there.
d) If you want me to create a sample that you can compile yourself, someone will ask why I dont compile it for them instead of giving the code.
e) The program is not malware.
f) This discussion is not over yet. And if I get what I want, it will not be put down, but developed into a new standard for C++ and other languages where it is trivial to program using your innate language.

Offline beqroson

  • Multiple posting newcomer
  • *
  • Posts: 63
Re: Generalizing programming language patterns in CodeBlocks
« Reply #21 on: November 09, 2013, 07:57:49 pm »
Instead of pseudo code, perhaps I can describe usage patterns that I personally would like to see.

Open a source code project downloaded from the net:
1. Open the project.
2. Select menu->languages->Italian, which immediately translates the source into the Italian language.

Compile the source project:
1. Press menu->Build, the Italian code is "JIT"-translated into code known by the current compiler, such as GCC.

Release a source header set:
1. Press menu->Export, the code is stripped off the Italian language and is left with only the compiler known language, such as C++.

Start using a third-party header dependent library, such as WxWidgets.
1. Download and install the header files.
2. Download and install/or create your own/ translation module that translates all the the terms, such as wxComboBox into wxKombinataBoxxy (or what it is called in Italy?  ???

Create your own source distribution, such as source code for CodeBlocks:
1. Create the source.
2. Attach a set of already completed source translation modules.
3. Pack it up in a bundle. The users can themselves select which language is preferred.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Generalizing programming language patterns in CodeBlocks
« Reply #22 on: November 10, 2013, 07:40:37 am »
Read this thread twice, I don't understand what you are going to achieve.
Only one question: Do you understand the "Parsing technology"? If the answer is yes, you can write parsers for a specific language. If the answer is no, I don't think can do much about "code completion feature".
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline beqroson

  • Multiple posting newcomer
  • *
  • Posts: 63
Re: Generalizing programming language patterns in CodeBlocks
« Reply #23 on: November 10, 2013, 12:58:02 pm »
Read this thread twice, I don't understand what you are going to achieve.
Only one question: Do you understand the "Parsing technology"? If the answer is yes, you can write parsers for a specific language. If the answer is no, I don't think can do much about "code completion feature".

No, I dont know specifics about any "Parsing technology". However, I have written a parser for equations, does that help?

Offline beqroson

  • Multiple posting newcomer
  • *
  • Posts: 63
Re: Generalizing programming language patterns in CodeBlocks
« Reply #24 on: November 10, 2013, 02:23:43 pm »
Read this thread twice, I don't understand what you are going to achieve.
Only one question: Do you understand the "Parsing technology"? If the answer is yes, you can write parsers for a specific language. If the answer is no, I don't think can do much about "code completion feature".

I will look into this about the code completion. I will be aiming at reusing the basic code completion plugin and place translation on it. This can be done for a specific language where a code completion plugin already exists. For a programming language with no code completion plugin available I was thinking to let the user tag their code invisibly by selecting from a pop-up menu and thus making the code completion feature available without using any parsing technology.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Generalizing programming language patterns in CodeBlocks
« Reply #25 on: November 10, 2013, 03:00:18 pm »
Instead of pseudo code, perhaps I can describe usage patterns that I personally would like to see.

Open a source code project downloaded from the net:
1. Open the project.
2. Select menu->languages->Italian, which immediately translates the source into the Italian language.

Compile the source project:
1. Press menu->Build, the Italian code is "JIT"-translated into code known by the current compiler, such as GCC.

Release a source header set:
1. Press menu->Export, the code is stripped off the Italian language and is left with only the compiler known language, such as C++.

Start using a third-party header dependent library, such as WxWidgets.
1. Download and install the header files.
2. Download and install/or create your own/ translation module that translates all the the terms, such as wxComboBox into wxKombinataBoxxy (or what it is called in Italy?  ???

Create your own source distribution, such as source code for CodeBlocks:
1. Create the source.
2. Attach a set of already completed source translation modules.
3. Pack it up in a bundle. The users can themselves select which language is preferred.
I still not understand what you want to get in those steps.
You just want to translate all the Italian words in one source file to English words??? Maybe, you should show us some code snippets, screen shots, patches againt current SVN Head, I don't want to download/try a binary if I know nothing about the binary.
 
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline beqroson

  • Multiple posting newcomer
  • *
  • Posts: 63
Re: Generalizing programming language patterns in CodeBlocks
« Reply #26 on: November 10, 2013, 03:13:57 pm »
Quote
I still not understand what you want to get in those steps.
You just want to translate all the Italian words in one source file to English words??? Maybe, you should show us some code snippets, screen shots, patches againt current SVN Head, I don't want to download/try a binary if I know nothing about the binary.
 

Ay, ay sir. ... Rethinking world definition, please hold...  :D

No, but seriously, I am listening to all you say here. Maybe I should create a completely different sample. Against SVN, create a plugin (if it is relatively swift to make a crude one?). At the moment I am mostly collecting opinions though. But, hard if you cannot see the whole picture.

Offline beqroson

  • Multiple posting newcomer
  • *
  • Posts: 63
Re: Generalizing programming language patterns in CodeBlocks
« Reply #27 on: November 10, 2013, 03:22:52 pm »
The reason I did not just upload the source was because the code is tied into the same code that is used for another project, of which I am not sure if I can share that code. However, when I create the plugin I will split up the code separately so that it can be included in the CodeBlocks project (if that happen).

Offline beqroson

  • Multiple posting newcomer
  • *
  • Posts: 63
Re: Generalizing programming language patterns in CodeBlocks
« Reply #28 on: November 10, 2013, 04:29:39 pm »
Nobody seems to be backing me up on this idea yet. Is there no good reason to be able to program in your own language? There is a reason that we have many languages on our globe, right? It creates boundaries between different cultures. Should we not reflect that in the business of C++ as well, or am I the only one thinking like that? Maybe, just maybe... just maybe, it would be better if I just go and do harakiri on myself, then I dont need to bother.  :P

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: Generalizing programming language patterns in CodeBlocks
« Reply #29 on: November 10, 2013, 04:34:02 pm »
Instead of pseudo code, perhaps I can describe usage patterns that I personally would like to see.

Open a source code project downloaded from the net:
1. Open the project.
2. Select menu->languages->Italian, which immediately translates the source into the Italian language.

Sounds like a mixed C Processor and Poedit combined with Comment Translator.  


Compile the source project:
1. Press menu->Build, the Italian code is "JIT"-translated into code known by the current compiler, such as GCC.

Sounds like a C Processor.


Release a source header set:
1. Press menu->Export, the code is stripped off the Italian language and is left with only the compiler known language, such as C++.

Sounds like a Text Processor tool.

So far, I see no need for a CB Plugin; I suggest trying out the CB  Contrib ToolPlus Plugin and see if that will do all that you need.
If nothing else it might be quicker during development.

Tim S.

C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org