LLVM

Everything else that doesn't fall into one of the other PB categories.
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Re: LLVM

Post by DoubleDutch »

If the compiler generated code and we could use OS native routines like we can do with the Win32 API then I don't think it would matter so much initially that the pb libs aren't done. With regard to ARM - I think that Android mainly uses the JVM so that code runs on both Android ARM and Android x86 - although you can write 'native' ARM though if you like. If there was a Basic (like pb) for Android then it would be best to target: ARM, JVM or x86/x64.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Re: LLVM

Post by Trond »

If the compiler generated code and we could use OS native routines like we can do with the Win32 API then I don't think it would matter so much initially that the pb libs aren't done.
A PB without strings, lists, arrays, and all the libraries wouldn't be much different from coding in plain C or Java, would it?
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Re: LLVM

Post by DoubleDutch »

Obviously some of the libs would need to be there initially - but the gfx, sound, window, etc wouldn't - just access to the native os libs.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
Coolman
Enthusiast
Enthusiast
Posts: 103
Joined: Sat Sep 03, 2005 4:07 pm

Re: LLVM

Post by Coolman »

Pour du vrai developpement multiplateforme, il serait possible de se baser sur QT (http://qt.nokia.com/) qui existe sur (linux, mac osx, windows mobile, windows ce, symbian, maemo, meego) :

http://qt.nokia.com/products/platform/platforms

http://doc.qt.nokia.com/4.6/supported-platforms.html

plus d'informations ici :

http://qt.nokia.com/products

**********************************************************************************************

For the true development platform, it would be possible to rely on QT (http://qt.nokia.com/) that exists on (linux, mac osx, Windows Mobile, Windows CE, Symbian, maemo, Meego)

http://qt.nokia.com/products/platform/platforms

http://doc.qt.nokia.com/4.6/supported-platforms.html

more information here:

http://qt.nokia.com/products

8)
*** Excuse my bad English, I uses has translating program ***
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: LLVM

Post by blueznl »

Desperate people could build their own FASM -> LLVM converter ;-)
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Seymour Clufley
Addict
Addict
Posts: 1264
Joined: Wed Feb 28, 2007 9:13 am
Location: London

Re: LLVM

Post by Seymour Clufley »

It may also help to use PB as a web programming language.
JACK WEBB: "Coding in C is like sculpting a statue using only sandpaper. You can do it, but the result wouldn't be any better. So why bother? Just use the right tools and get the job done."
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: LLVM

Post by blueznl »

It's not a bad idea, but I guess it would require a different apporach ie. level of cross platform compatibility...

Something like...

- all features - Windows (hehe)
- most features - Linux
- less features - Apple ;-)
- least features - LLVM for web or mobile using some multi platform GUI framework

The more one would go cross platform, the smaller the command set available, but it would allow building mobile apps with the same great language.

But, there's a catch, it is a *lot* of work for Fred & Co, so I *could* imagine they are *somewhat* reluctant :-) especially as they have not completed my requested feature list yet :twisted:

Then again, it would provide a pathway to mobile Android / Apple devices, but at what cost...
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Re: LLVM

Post by DoubleDutch »

Seymour Clufley: Hadn't seen that before - thanks for the link.

The more I look, the more it looks like everyone is going down the LLVM route - even Adobe for flash compilation to real native exe on iPhone!
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
Thorium
Addict
Addict
Posts: 1305
Joined: Sat Aug 15, 2009 6:59 pm

Re: LLVM

Post by Thorium »

freak wrote: > But i dont think the resulting compiled code can be more optimized than a direct compiler can do.
> You just can't use CPU specific stuff very smart.

Why not? The CPU specific optimizations are done by the code-generator for the target platform. This comes after the general optimizations are applied to code in IR. Also, LLVM can do a lot of things that ordinary compilers can't do. It can run all its optimizers even after link-time, so things like inter-procedural optimizations become much more effective than applying them to each compiled module separately. Link-time optimization is something that only few compilers/linkers do well and even then they do it only for a few kinds of optimizations. In LLVM, this is part of the basic design from the beginning.
Maybe i am wrong but as i understand it, the high level code will be broken down into this low level LL code, which then gets broken down into asm.
So this LL code need to be very universally and architecture independant. I just guess there is a chance that there is some overhead added by doing two compiles. We allready have overhead if we compile from high level directly to asm. So here we do it 2 times.

Does this LLVM have architecture independant SIMD functionality? That would be awesome.
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Re: LLVM

Post by freak »

@DoubleDutch

PureBasic without its libraries and debugger is just a nicer looking version of C. You wouldn't be happy with that for long.
I understand your wish to write programs for phones with PB, but its not going to happen any time soon. You'll just have to live with that.

@Thorium

Its not really an assembly language. It just looks like one. It is a code representation in static single assignment form (http://en.wikipedia.org/wiki/Static_sin ... nment_form) including full type information on all values. This is the same kind of code representation used by many compilers (including gcc since version 4) to represent the code in the steps between the compiler front-end and the back-end (where higher-level optimizations are done). The LLVM IR is just a readable form of what most compilers do behind the scenes as well.
This is why LLVM is nice for compiler writers: You just have to do a decent front-end which generates SSA and LLVM can do all the rest for you.

> Does this LLVM have architecture independant SIMD functionality? That would be awesome.

It does. There is a "vector" data type which can be used with many instructions. The code generators will generate SIMD instructions for that if the target platform provides them.
quidquid Latine dictum sit altum videtur
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Re: LLVM

Post by DoubleDutch »

Freak: Ok, np - consider the subject closed. :)
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
Coolman
Enthusiast
Enthusiast
Posts: 103
Joined: Sat Sep 03, 2005 4:07 pm

Re: LLVM

Post by Coolman »

DoubleDutch wrote:
If purebasic evolved and can directly generate C code directly compilable by LLVM, it would be exceptional because it would be possible to generate executables for different architectures (x86, x64, arm ...)
Shouldn't that read:
If purebasic evolved and can directly generate 'll' code directly compilable by LLVM, it would be exceptional because it would be possible to generate executables for different architectures (x86, x64, arm ...)
?
DoubleDutch, desolé, je n'avais pas vu ton post, j'utilise le traducteur de google mais je crois que c'est bien ce que je voulais dire, le language c c++ est je penses plus portable que tout les autres, il me semble logique de generer a partir de la syntaxe de purebasic un code c c++ directement compilable par LLVM,ca permettrait a long terme de reduire la charge de travail de l'auteur, si en plus QT etait utilisé, alors il serait possible de compiler directement sans modification de la GUI pour differentes plateformes comme je l'ai indiqué plus haut...

Cela dit, la reponse de Freak est mauvais signe, je serais curieux d'entendre celle de fred qui est apres tout le plus concerné...

Si c'est la meme, alors c'est bien dommage de gacher autant de competence dans un projet qui restera a mon avis marginal...

Je continuerais cependant a utiliser purebasic mais uniquement pour de petits projets...

Note : J'ecris ce post en francais parce que l'auteur est francais, n'y voyez aucun manque de respect...

8)

**********************************************************

DoubleDutch, sorry, I had not seen your post, I use google translator but I think that's what I meant, the language c c + + I think is more portable than any other, I seems logical to generate from syntax purebasic code c c + + directly compilable by LLVM, it would allow long-term to reduce the workload of the author, if in addition to QT was used, then it would be possible to compile directly without changing the GUI for different platforms as I mentioned above ...

However, the reply from Freak is a bad sign, I'd be curious to hear that fred is after all most concerned ...

If it is the same, so it's a shame to spoil as much expertise in a project that will remain marginal in my opinion ...

I will however continue to use purebasic but only for small projects ...

Note: I am writing this post in french because the author is french, do not see any lack of respect ...

8)
*** Excuse my bad English, I uses has translating program ***
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Re: LLVM

Post by DoubleDutch »

Coolman: no problem. I know it's a shame that they couldn't have used this technology as it looks like a lot of big companies are helping with LLVM (adobe, apple, google, etc) - so imho it could save them time and effort in the long run. Maybe when PureBasic has the next big major release - I mean from 4.xx to 5.0 they may have a change of mind?
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: LLVM

Post by blueznl »

We will know before christmas :-)
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Re: LLVM

Post by DoubleDutch »

I don't think it be 5.0 before Christmas - I reckon this years present will be 4.60. ;)
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
Post Reply