4 ms·
Outside of C, are there any other languages or platforms that can do this? I'd like something modern, but I haven't liked what I've seen with Rust personally.
by akhilcacharya 11y ago
Outside of C, are there any other languages or platforms that can do this? I'd like something modern, but I haven't liked what I've seen with Rust personally.
- pjmlp 11y agoStill alive: Ada, SPARK, ATS, FreePascal, D Controversial: Go (if someone ports the runtime to bare metal), embedded JVMs, embedded, Swift (depending how Apple drives it), .NET Native (if C# gets missing features from System C#) Faded away: Algol, PL/I, CPL, Mesa, Modula-2, Modula-2+, Modula-3, Oberon, Oberon-2, Active Oberon, Component Pascal, Turbo Pascal, Forth, Sing#, System C#
- jeremyjh 11y agoI think he was asking which languages could actually be used to do this today, without writing a new cross-compiler first.
- akhilcacharya 11y agoThat's exactly right. I didn't know that D would be an appropriate language for things like this - I'll have to check it out.
- pjmlp 11y agoCheck some of the videos here http://wiki.dlang.org/Videos http://wiki.dlang.org/Videos Namely "Tiny, Ubiquitous Machines Powered by D" and "x86 Bare Metal and Custom Runtime Programming".
- pjmlp 11y agoYou always need a cross-compiler, or a VM. There is no way around it.
- jeremyjh 11y agoI don't have a problem with needing a cross-compiler, but I don't want to write one. I don't have to write my own if I use Rust. Or D, or C. But I can't find such a thing for ATS for example. So just being a language which has semantics to support this is not sufficient to be declared a language "which can do this". I would also need to be able to download a toolchain which can do this.
- pjmlp 11y agoOk, but that is a matter of availability of implementations, not a language feature.
- dom96 11y agoDon't forget to add Nim to that list! One of Nim's defining features (compilation to C) makes it work rather well for this sort of thing.
- pjmlp 11y agoForgot about that one sorry. Compilation to C is a toolchain feature, not a language one.
- e12e 11y agoAnd C++, surely? (Although, I would probably choose C (or even assembler) over C++ for something this simple (loop, blink a light). And between all those, I think Rust is really interesting. It could probably be argued that Rust doesn't add much on top of D (as a "better" C++) -- but between the mind-share and the focus on "safe" (and boxing in unsafe) memory access, I think Rust is really interesting. Not sure how run-time free D is coming along - believe there were some issues with the standard lib? Ada was troubled by a confusing split between FSF LGPL Gnat trailing Ada Core GPL/commercial compiler with a release -- leaving people a little confused if there was a good Free Ada compiler that could be used for commercial (or just non-GPL) development. (Yes, it was a real issue, just as one needs an LGPL libc for c development etc). But as I understand it the GNAT compiler has matured to the point that one can now use modern Ada without having to worry about that. Unfortunately Ada probably lost a lot of potential developers due to the confusion/issue.
- pjmlp 11y agoI left C++, Objective-C and Objective-C++ out, because of the C compatibility. The price of commercial compilers wasn't the only issue with Ads. It never had any friends in the UNIX culture. UNIX culture always ignored safer system programming languages from the 60 and 70's. If the hacker culture bashes Java for being verbose, what would they say about Algol languages like Ada? Another problem was Ads was mainly a DoD thing, there were no commercial OSes using it. So you either used the system programming language of the OS, if you were lucky to access to the official SDK, or bought one you could afford. There was always an option to type it all in as well. So with these constraints it was hard to get Ada widely adopted. It is now mainly used in avionics, train control systems and high integrity systems. All areas that the common Starbucks coder usually doesn't care about. As for D there are some projects using it on micro-controllers, presented at D Conf 2014. In comparison to Rust, it might appeal to those that favour a C++ like syntax, interoperability with C++, GC support, great metaprogramming capabilities. I like both, and think there might be space for both of them.
- e12e 11y agoI've only toyed with Ada, but it doesn't strike me as particularly verbose? [ed1: eg: http://rosettacode.org/wiki/N-queens_problem#Ada http://rosettacode.org/wiki/N-queens_problem#Ada compares pretty favourably/neutrally in my mind to the C++ version in terms of verbosity (or lack thereof). Unless one gets upset about "end loop" vs "}" ] [ed3: Hm, I guess looking at: http://rosettacode.org/wiki/Balanced_brackets#Ada http://rosettacode.org/wiki/Balanced_brackets#Ada I could see Ada as being derided as verbose... maybe :-) ] [ed2: And looking a bit more at rosettacode, I now found: http://forge.ada-ru.org/matreshka http://forge.ada-ru.org/matreshka (Quite unrelated to the rest of the discussion here, but anyone else interested in poking at Ada might find it interesting) ]