Announcement

Collapse
No announcement yet.

April Fools' Or Should Wayland Switch Away From Using C?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • uid313
    replied
    Originally posted by Electric-Gecko View Post
    I have not attempted either C or Haskell. I have barely any programming skills, and I have barely managed to add anything to C++ projects.

    So tell me, does Haskell have everything it needs to replace C for systems programming, particularly the examples of Wayland and Linux kernel we're discussing? Does it have any serious issues compared to C (in systems programming), or is it just the inertia of people to switch over (like the inertia of regular computer users to switch from Windows to Linux)? Is Haskell fundamentally harder to program in than C?
    Haskell is a different paradigm which people are familiar with.
    Most programmers are familiar with imperative object-oriented languages. Haskell is functional programming, so it is different.

    Originally posted by Electric-Gecko View Post
    I do agree that there are some projects that would be worth changing to a different language, but don't rewrite C as C++. C++ is also problematic, and should actually be replaced by better newer languages. Please don't treat C++ as the modern way which everything should switch to.
    Also, C is more compatible. D is fully compatible with C, but not compatible with all C++ projects. I'm not an expert, so I don't really understand how it works. I read that OGRE is not compatible with D because it uses multiple inheritance (which D does not support). But then, doesn't Qt use multiple inheritance? Qt is also C++, but has bindings for D.

    D was actually written as an alternate continuation of C rather than a continuation of C++. It's goal is to better implement the functionality of C++.

    I think there are some C++ projects worth rewriting in D. It would be easier for newbies like me to contribute, but also make development faster in general.
    D have existed for a long time but failed to get any traction.
    Instead there is Rust which is the new cool kid on the block.

    Is D less relevant nowadays with C11?
    Is there any successor to C11?

    Leave a comment:


  • Hi-Angel
    replied
    Originally posted by Electric-Gecko View Post
    I have not attempted either C or Haskell. I have barely any programming skills, and I have barely managed to add anything to C++ projects.
    I found at some point a nice way to learn basics of a new language: just solve a couple of tasks from Google Codejam. They're small, and cover the basics, like reading from/to a file, parsing; and if you're a beginner you'd need to print statements, debug the code a bit.

    Originally posted by Electric-Gecko View Post
    So tell me, does Haskell have everything it needs to replace C for systems programming, particularly the examples of Wayland and Linux kernel we're discussing? Does it have any serious issues compared to C (in systems programming), or is it just the inertia of people to switch over (like the inertia of regular computer users to switch from Windows to Linux)? Is Haskell fundamentally harder to program in than C?
    It does have a problem with regard to systems programming, it's called garbage-collector.

    That said, Haskell is a language worth knowing even if you're not intending to ever use it. If your coding skills are in stage where you can embody simple algorithms in code, but struggle to architect apps the right way, e.g. your code is full of global variables, awkward error handling, race conditions, and you struggle to see the time to break a function — it's time to learn some Haskell. The language forces you into better design, it teaches you some generic style that you can later apply in any language.

    For example, from just C/C++ background, function pointers was always looking like odd beasts to me, I'd hardly ever use them, except as if the algorithm jumped at me screaming "use a function pointer FFS!" (well, it was 2-3 years ago, I didn't know about C++14 closures back then). But in Haskell they're as natural as they can be, so after you get back from Haskell to C/C++, you'd just start seeing patterns where function pointer can make your life much easier. (that said, back then I didn't even hear about Haskell, and learned the same thing from elisp, but both langs treating functions in alike manner, so it doesn't really matter)

    Leave a comment:


  • Electric-Gecko
    replied

    Originally posted by uid313 View Post
    Haskell is a good way to alienate developers. It is rarely used outside academia. Most programmers are not familiar with it.
    Originally posted by cipri View Post
    This is clear to me that this was "one" of the (pseudo-) reasons why c was chosen, but I think the real/main reason was that the "wayland" developers grew up with c ! There is so much software in the unix world that is written in c that should have been written with c++ from the beginning. As far as I understand mir is based on c++ [I didn't check it closer since I don't like their license].
    I have not attempted either C or Haskell. I have barely any programming skills, and I have barely managed to add anything to C++ projects.

    So tell me, does Haskell have everything it needs to replace C for systems programming, particularly the examples of Wayland and Linux kernel we're discussing? Does it have any serious issues compared to C (in systems programming), or is it just the inertia of people to switch over (like the inertia of regular computer users to switch from Windows to Linux)? Is Haskell fundamentally harder to program in than C?

    Originally posted by cipri View Post
    I would like to see that the linux world starts to rewrite old code - so that we can build on safer libraries. Let's stop with c, and use it just in very specific places. You even don't need c for writing the kernel: check out for example this: http://okmij.org/ftp/cpp-digest/toy_OS.txt
    I do agree that there are some projects that would be worth changing to a different language, but don't rewrite C as C++. C++ is also problematic, and should actually be replaced by better newer languages. Please don't treat C++ as the modern way which everything should switch to.
    Also, C is more compatible. D is fully compatible with C, but not compatible with all C++ projects. I'm not an expert, so I don't really understand how it works. I read that OGRE is not compatible with D because it uses multiple inheritance (which D does not support). But then, doesn't Qt use multiple inheritance? Qt is also C++, but has bindings for D.

    D was actually written as an alternate continuation of C rather than a continuation of C++. It's goal is to better implement the functionality of C++.

    I think there are some C++ projects worth rewriting in D. It would be easier for newbies like me to contribute, but also make development faster in general.

    Leave a comment:


  • starshipeleven
    replied
    Dafuq is haskell anyway? (rethoric question)

    Leave a comment:


  • Jabberwocky
    replied
    Originally posted by johnc View Post
    If they really want to make Wayland perfect they should just copy and paste all of the X.org code.
    Nominating this for "golden comment 2017" 😂

    Leave a comment:


  • cj.wijtmans
    replied
    They should convert wayland protocol to json. Json parsing in php is much faster than xml parsing.

    Leave a comment:


  • coastiron
    replied
    reply to post #23
    Does anybody here believe that the quality of software depends on the features of a programming language rather than on the abilities of the developers?
    Yes. There are errors that you can't do in some languages. They would be statically found by compiler.
    Have you heard of Sapir–Whorf hypothesis? I know it is originally not about programming. Most programmers knew about this hiphotesis even before "Arrival" movie


    reply to post #30
    If you want to write a Wayland client, you do not have to use the C bindings. If you choose to write a Wayland client using libwayland-client, you do have to use the C bindings, because libwayland-client is the C-language bindings library generated from the Wayland protocol spec.

    Wayland is language-neutral. Language agnostic. It is not written in C. You do not have to use C.
    Yes but Wayland Developers also invest they time in writing reference library. This library is influencing others projects and de facto it is a library of choice for most projects directly interfering with Wayland.
    Anyway most programmers should use GTK+ or QT5 or some other GUI toolkit.
    Last edited by coastiron; 04-03-2017, 11:59 AM.

    Leave a comment:


  • cj.wijtmans
    replied
    So when will micheal switch his website to rust? We can rewrite everything in rust.

    Leave a comment:


  • pipe13
    replied
    Originally posted by ⲣⲂaggins View Post



    Your post only ridicules the first half of his claim, namely the half that says



    Now does anyone here really believe that a certain language places lower bounds on software quality, regardless of how stupid a developer might be?</s> I hardly need to ask...
    Better to catch the corner cases in the test suite than have an application engineer phone them in from the field.

    Leave a comment:


  • FishB8
    replied
    It's inevitable that any core infrastructure project will get hit by an RIIR proposal...
    https://transitiontech.ca/random/RIIR
    https://daniel.haxx.se/blog/2017/03/27/curl-is-c/

    Leave a comment:

Working...
X