[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Parallella Community • View topic - generating epiphany code from templates, possible?

generating epiphany code from templates, possible?

Discussion about Parallella (and Epiphany) Software Development

Moderators: amylaar, jeremybennett, simoncook

Re: generating epiphany code from templates, possible?

Postby piotr5 » Sun Aug 23, 2015 9:32 am

piotr5
 
Posts: 230
Joined: Sun Dec 23, 2012 2:48 pm

Re: generating epiphany code from templates, possible?

Postby dobkeratops » Sun Aug 23, 2015 12:44 pm

dobkeratops
 
Posts: 189
Joined: Fri Jun 05, 2015 6:42 pm
Location: uk

Re: generating epiphany code from templates, possible?

Postby piotr5 » Tue Aug 25, 2015 10:32 am

in c++ expressing intent is a bit over-enthusiastic. intent you could already express in c, the problem is the compilers are too stupid to understand it. if you want to express something in c++, it better be the desired assembler-code generated underneath. again, same can be done in c. difference is only that in c++ you additionally are capable of expressing the compiler's behaviour when encountering some rare or hopefully rare cases of misunderstanding between programmers. unfortunately, I am not aware of any programming language capable of expressing intent, there's always quite a lot of bureaucrazyness to overcome first. in a simple case, you may express your intent that whatever turtle walks a few steps forward and turns left and so on, always leaving a trace behind. but after that walk there will appear some beautiful star on the screen which you couldn't have generated by simply saying "draw me a star". this is a problem inherent in what we call "intent", we'd like the computer to make decisions for us, and if we're unhappy we'd like to tell it to try again and specify our intent a bit more clearly. this actually is a searching problem, solveable by loads of supercomputers attempting to decode everything surveillance has gathered about human beings. when you say draw me a star, there are many ways to do that, the computer would need to know them all, either by collecting that info or better yet by comprehending what it is that makes a shape into a star-shape and then searching for all such shapes. once that's done, a random shape could be chosen. stating intent basically has little to do with programming, intent is what google is after while programmers tend to just collect a list of possibilities on their own and choose among such a limited list.

I know it's a bit off-topic now, but let's use it as an example: the "Moveable" concept is a bit fragile. suppose you have a lib for numbers, are numbers moveable? principially a number could be moved, it does not depend on memory-position. however, if there is a central cache, containing all numbers so they are stored only once and never again, would such a cache then also store all positions where such numbers are referenced from? silly idea, but it destroys the moveable property. generally if you depend on 3rd party libs, the underlying objects could easily change in a way that breaks moveability, without changing the interface.

another example: usually c-programs either pass by reference and thereby introduce non-reentrant code (to store the created object in a static variable), or they create copies of lots of objects, cluttering memory so that garbage collection is needed. c++ recently introduced R-value to solve that. so, you have some sort of pick-casting to prepare a value for that kind of function, then you must write a pick-function to move over another objects data-ownership to yours, and call a setPicked function for the other object so that future access to its data generates runtime-errors. if you do such a change with existing objects, then you'd better remove copy-constructor and rename it into a 2-argument constructor. additionally the single equal-sign operator must perform the picking and therefore isn't allowed to pass a reference to this object on output, it returns void. then compile your sources and whenever copy-constructor or assignment is used, you must then make a decision based on context: should a picking or a deep-copy be performed? the original author did not express his/her intent on that topic, you must add more details to how the intent really looks like. and now suppose you have a co-worker who is unable to comprehend the notion of picking and deep copy. now you must change sources again, this time removing expression of intent again. well, in that case c++ offers some possibilities to just change definitions, so it compiles with intent inside even though it wont get used. but if the coworker doesn't continue that statement of intent, then your code has mixed depth of exactness, it is inconsistent, your stating of intent becomes useless. so you need tools to mark all changes done by that co-worker for reviewing and add this increased intent yourself.

what I claim here is, with parallelization you'll face all the same problems again! what we really need is more code-refactoring tools. the whole argumentation with programmers are lazy, small code is beautiful, easiness over changeability, all that is really a moot point in face of what nowadays IDE can do for you. the for-loop in old-style you presented, nobody wrote such for-loops actually, they just told the IDE to create such a loop for them! imho the old iterator loops are to be preferred over the new foreach loops, there you did get the actual iterator into hand and not the value it is pointing to. you can do a lot of stuff if only you have the iterator!

my suggestion is, dig out some good IDE, and improve it for easier parallell programming. I'd choose to use qt-creator, although my favourite is U++. but if you wish, you can as well use clion. or preferably, write code for code-refactoring, portable among all 3 IDEs, code that works on linux-kde c++ as well as on windows java...

I must emphasize: using templates or whatever pre-compiler programming, this will increase build-time and steal memory-ressources during compilation. if it isn't necessary because a good IDE can do all that much cheaper, why not use that option? why not code-generating instead of compile-time execution?
piotr5
 
Posts: 230
Joined: Sun Dec 23, 2012 2:48 pm

Re: generating epiphany code from templates, possible?

Postby dobkeratops » Tue Aug 25, 2015 12:17 pm

dobkeratops
 
Posts: 189
Joined: Fri Jun 05, 2015 6:42 pm
Location: uk

Re: generating epiphany code from templates, possible?

Postby Silexica » Sun Oct 18, 2015 7:13 pm

Very interesting posts with some great ideas. I want to present our current solution, as it includes some bits and pieces from this thread as well. It is commercial though, so hopefully not off-topic in this thread/forum.

You can specify your application in a data-flow way, with each process node just being regular C (C++ soon) code and FIFO communication between them. From there, our solution will analyse the application, do performance estimation for the available processor cores and available communication means and distribute it automatically to a given homo- or heterogeneous target system in space and time. Using such a generated mapping (or using a manually specified one) for communication and computation, we generate ready-to-run source code for the individual cores which can then be compiled by native c compilers and executed on the board. This is enabled by our own compiler using clang AST transformations to go from one AST to another one. Supported targets are x86 pthread, ARM, TI OMAP, TI Keystone, and the parallella board as well now, including performance estimation and code generation for both processor core types.

Looking forward to your thoughts or questions.

Cheers,
Max


PS: If you want to know more, have a look at the SLX Mapper: http://silexica.com/products/

PS2: there are lots of thoughts on future developments, including a free version for academic/personal use, open-sourcing the compiler, etc. so happy to hear your ideas
Silexica
 
Posts: 2
Joined: Sun Oct 18, 2015 6:56 pm

Re: generating epiphany code from templates, possible?

Postby dobkeratops » Fri Oct 30, 2015 4:32 am

dobkeratops
 
Posts: 189
Joined: Fri Jun 05, 2015 6:42 pm
Location: uk

Previous

Return to Programming Q & A

Who is online

Users browsing this forum: No registered users and 6 guests

cron