5 ms·
I see it's written mostly in Vala - I must confess I have a deep prejudice against Vala, mostly because it seems silly and complicated and just wrong to me to t
by gregopet 9y ago
I see it's written mostly in Vala - I must confess I have a deep prejudice against Vala, mostly because it seems silly and complicated and just wrong to me to take a programming language and then compile it to C and then further compile it to machine code. We have that situation in Javascript land but at least there it was kind of unavoidable for a very long time.
That said, I may take Pantheon for a spin - I've been a happy KDE user for many years but I never mind trying new things and perhaps learning something new. Everything I've tried so far made me return back to KDE but one must keep an open mind.
- pjmlp 9y ago> I see it's written mostly in Vala - I must confess I have a deep prejudice against Vala, mostly because it seems silly and complicated and just wrong to me to take a programming language and then compile it to C and then further compile it to machine code. You mean like Objective-C, C++, Eiffel, Scheme, Nim? Compiling to another native language is a shortcut to avoid implementing a complete compiler backend. With C being the best option as target language on UNIX systems, given its ubiquity.
- iforgotpassword 9y agoC++? Unless you're talking about the very first compiler ever or some toy project, you're wrong, and I'd actually guess the same is true for obj-c.
- pjmlp 9y agoOf course I am speaking about CFront. C++ first compiler that actually generated native code without going through C was written by Walter Bright sold by Zortech, which then sparked the race from all other compiler vendors. Objective-C started as a macro processor for C, hence the [ ] syntax and @ prefixes, to make it easier to find them. Nowadays the macro processor is gone, but at assembly level Objective-C code still gets translated into a bunch of objc_msgSend() and similar calls.
- Longhanks 9y agoAnd objc_msgsend is implemented in Assembler. ObjC does NOT get compiled to C first.
- pjmlp 9y agoThat optimization came later in the game. Again, the point is that Objective-C started as macro processor generating C code, which gregopet states it is silly for Vala devs to choose the same path as Brad Cox and Tom Love decided for their language.
- the_why_of_y 9y agoAlso, GHC for a very long time would only generate C code and IIRC even bundle GCC in the Windows builds; it's still available as the -fvia-C option in current versions. GNU Common Lisp comes to mind as well (not to be confused with GNU CLisp, which is an interpreter implemented in C).
- dom96 9y agoCompiling to C is actually an advantage. It seems to me that for most people the aversion to it is mostly a feeling, with very little objective reason for it. Have you tried a language that compiles to C? If not then don't knock it before you try it. If you have experiences that prove why its a disadvantage then please do share.
- qznc 9y agoI have used tools like lexer or parser generators which generate C code. Debugging is a painful due to the indirection. Writing a LLVM backend is not harder than generating C code in the long run. The only advantage of the C code option is portability, so if you target some crazy microcontrollers C is fine.
- dom96 9y agoThere is more than just that advantage. By compiling to C you can easily take advantage of C++/Objective C features and allow easy wrapping of libraries written in those languages. FWIW I never had any issues debugging Nim (a language that compiles to C or C++ or Obj C)
- the_why_of_y 9y agoFor Vala, generating C is more appropriate than LLVM, because its whole point is to integrate with the GObject object system, and that is defined by C headers that contain lots of C preprocessor macro definitions.
- gurkendoktor 9y agoVala is a strange beast, but it's type-safe and expressive enough that the code for most Pantheon apps is pretty easy to navigate. Compared to dealing with Apple's frustrating bug reporter or Ubuntu's launchpad system, reporting or even fixing a Pantheon bug on GitHub feels like a breath of fresh air. That said, the current Loki (0.4) release is in maintenance mode already; I'd wait for the Juno (5.0) release.