Author Topic: nimrod, new language, interesting compiler/interpreter  (Read 22441 times)

0 Members and 1 Guest are viewing this topic.

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: nimrod, new language, interesting compiler/interpreter
« Reply #25 on: September 22, 2013, 07:51:06 pm »
ADA ? If you work for avionic you MUST use ADA, may be you can use also C for the low level stuff (kernel are written in C), but we are talking about an extremely safe C, which means Misra Checked and Validated.

ADA is cool, the problem is that is very difficult to qualify a compiler as "ADA", i mean that a compiler to be called "ADA compliant" MUST pass a lot of tests.

GNAT is ADA, and is very cool, try it out, it's OpenSource! There is just a little eggs problem: to compile the GNAT compiler you need a GNAT compiler, so if you look at gentoo repository you find that this is only possible (means binary compiler boot-strappers only available) for
- X86/linux
- PowerPC/linux
- Arm/Linux (maybe, there is something old around)

- MIPS/Linux and other arch are not supported!


p.s.
i checked this time ago, it may be changed, check yourself for any updated detail
 

Offline madires

  • Super Contributor
  • ***
  • Posts: 7695
  • Country: de
  • A qualified hobbyist ;)
Re: nimrod, new language, interesting compiler/interpreter
« Reply #26 on: September 22, 2013, 08:54:03 pm »
All those discussions about which programing language to use are futile. MCU/CPUs are running with machine code, so any language is just an abstraction layer to formulate what should be done by the CPU. Some programing languages are easier to learn than others, some are optimized for a specific area of features, other ones are less error-prone for beginners and so on. If you're happy with language X then use X. But a programing language isn't a religion so please don't try to missionate anybody else!
 

Offline c4757p

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: nimrod, new language, interesting compiler/interpreter
« Reply #27 on: September 22, 2013, 08:58:22 pm »
This is basically my argument against "we don't need yet another programming language". Just don't use it if you don't like it... I personally like choice...

Of course, in this case I will choose not to use it because I think it looks dumb. But that is my opinion and I only think I'm a little better than people who disagree... >:D
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline jeremy

  • Super Contributor
  • ***
  • Posts: 1079
  • Country: au
Re: nimrod, new language, interesting compiler/interpreter
« Reply #28 on: September 22, 2013, 09:15:24 pm »
Not sure I understand all the python hate here guys  ;)

You can use tabs or spaces, you just can't use both. Any text editor with more brains than notepad automatically converts between the two. You can also indent a single space or five spaces if you like, the interpreter will still accept it as long as it is consistently used (that's the key to python: it forces consistency).

Also, hunting for indentation errors is really not that bad. You get an IndentationError with a line number, so you go to that line and then you change the indent. Even my first year students can work this one out pretty easily  :P

Jokes aside, I'm a big fan of python as an "idea testing" language. Usually anything important needs to be in C anyway for speed. I really don't mind the syntax of C either.
 

Offline andyturk

  • Frequent Contributor
  • **
  • Posts: 895
  • Country: us
Re: nimrod, new language, interesting compiler/interpreter
« Reply #29 on: September 23, 2013, 03:11:23 am »
Not sure I understand all the python hate here guys  ;)
<rant>
Because what's fricken wrong with fricken braces!

Jeebus! Is it too much to type '{' and '}'? It's not like we're asking you to go back to Pascal with 'begin' and 'end'--we know how that makes your little fingers hurt.

Aw.

But what really yanks my nosehairs is getting a screenful of Python code, indented to N+7 levels and trying to figure out which somewhat less indented code lines up with some other less indented code that scrolled off the top of my emacs window.

Why, Guido? Why?
</rant>
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 8240
Re: nimrod, new language, interesting compiler/interpreter
« Reply #30 on: September 23, 2013, 09:44:33 am »
Also, hunting for indentation errors is really not that bad. You get an IndentationError with a line number, so you go to that line and then you change the indent.
The problem is a lot of communication mediums which strip leading spaces, completely destroying the structure of the program. With something like C the code still works if you copy+paste and lose all the indentation (and there are programs that will easily put them back so it's easier to read); with Python, you're left with a completely nonfunctional program. Beginners pasting code on forums and such get caught by this the most.
 

alm

  • Guest
Re: nimrod, new language, interesting compiler/interpreter
« Reply #31 on: September 23, 2013, 09:58:08 am »
One issue that you might have in C that you won't have in this language:
Code: [Select]
if (success != 0)
    errno = -1;
    return errno;
errno = 0;
When will the last line be executed? ;)
 

Offline Bored@Work

  • Super Contributor
  • ***
  • Posts: 3932
  • Country: 00
Re: nimrod, new language, interesting compiler/interpreter
« Reply #32 on: September 23, 2013, 10:03:43 am »
One issue that you might have in C that you won't have in this language:
Code: [Select]
if (success != 0)
    errno = -1;
    return errno;
errno = 0;
When will the last line be executed? ;)

Never, and the compiler will warn you. The problem is not with C, it is with the one who wrote that code. Like there will always be people who manage to grap the hot end of the iron, there will always be idiots who can't read their own C code and see what they did.
I delete PMs unread. If you have something to say, say it in public.
For all else: Profile->[Modify Profile]Buddies/Ignore List->Edit Ignore List
 

Offline komet

  • Supporter
  • ****
  • Posts: 155
  • Country: ch
  • Shenzhen Retroencabulator Mfg. Co.
Re: nimrod, new language, interesting compiler/interpreter
« Reply #33 on: September 23, 2013, 10:04:33 am »
Beginners pasting code on forums
Programs not working if you copy/paste them without understanding them might be considered a feature.
 

alm

  • Guest
Re: nimrod, new language, interesting compiler/interpreter
« Reply #34 on: September 23, 2013, 10:08:08 am »
Never, and the compiler will warn you.
The compiler will only warn because I happened to put a return there. Not if it was some other statement that gets inadvertently executed. Or are C compilers warning for whitespace now? ;)
 

Offline madires

  • Super Contributor
  • ***
  • Posts: 7695
  • Country: de
  • A qualified hobbyist ;)
Re: nimrod, new language, interesting compiler/interpreter
« Reply #35 on: September 23, 2013, 10:12:33 am »
One issue that you might have in C that you won't have in this language:
Code: [Select]
if (success != 0)
    errno = -1;
    return errno;
errno = 0;
When will the last line be executed? ;)

If the C equivalent would be:

Code: [Select]
if (success != 0)
{
    errno = -1;
    return errno;
}
errno = 0;

then I'd scratch my head about using whitespaces to define a code block.
 

Offline Bored@Work

  • Super Contributor
  • ***
  • Posts: 3932
  • Country: 00
Re: nimrod, new language, interesting compiler/interpreter
« Reply #36 on: September 23, 2013, 10:33:42 am »
Never, and the compiler will warn you.
The compiler will only warn because I happened to put a return there. Not if it was some other statement that gets inadvertently executed. Or are C compilers warning for whitespace now? ;)

Then you will have to live with the smell of burning flesh. The thing is some people never learn their tools and will again and again grap the iron at the wrong end. Or get their C code wrong.

All these rubbish new languages just show the old saying, try to make something idiot proof and you find better idiots. The reality is, these days the majority of people who write programs should never be let near a computer, and no "idiot proof" programming language can fix these people, who have no talent, no clue, no experience.
I delete PMs unread. If you have something to say, say it in public.
For all else: Profile->[Modify Profile]Buddies/Ignore List->Edit Ignore List
 

Offline lapm

  • Frequent Contributor
  • **
  • Posts: 564
  • Country: fi
Re: nimrod, new language, interesting compiler/interpreter
« Reply #37 on: September 23, 2013, 10:41:48 am »
Hate to say this, but i was wondering too why we need yet another language?
Electronics, Linux, Programming, Science... im interested all of it...
 

jucole

  • Guest
Re: nimrod, new language, interesting compiler/interpreter
« Reply #38 on: September 23, 2013, 11:09:09 am »
I think it's ok if you have a thing for languages with that type of syntax,  but I personally much prefer the C, C++ syntax.    Also, in the docs it says "The compiler generates optimized C code"   so why wouldn't you just write it in C anyway?
 

jucole

  • Guest
Re: nimrod, new language, interesting compiler/interpreter
« Reply #39 on: September 23, 2013, 11:19:55 am »
Talking of languages - if you're tired of using C,  you can always try D  http://dlang.org/overview.html  ;-)
 

Offline c4757p

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: nimrod, new language, interesting compiler/interpreter
« Reply #40 on: September 23, 2013, 11:48:33 am »
One issue that you might have in C that you won't have in this language:
Code: [Select]
if (success != 0)
    errno = -1;
    return errno;
errno = 0;
When will the last line be executed? ;)

Stop editing your code on punch cards, and your editor will warn you or fix it...
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline TerminalJack505

  • Super Contributor
  • ***
  • Posts: 1310
  • Country: 00
Re: nimrod, new language, interesting compiler/interpreter
« Reply #41 on: September 23, 2013, 12:13:31 pm »
I think the only new programming language that will be available on a wide variety of low-end MCUs (MCUs incapable of hosting Linux, for example) for the next 5 to 10 years is going to be C++11.

You might argue that this isn't a new programming language but they made quite a few changes to the language with C++11.  Some of them are meant to make the language "kinder and gentler" for noobs.  (The auto keyword, for example.)
 

Offline jeremy

  • Super Contributor
  • ***
  • Posts: 1079
  • Country: au
Re: nimrod, new language, interesting compiler/interpreter
« Reply #42 on: September 23, 2013, 12:33:43 pm »
The reality is, these days the majority of people who write programs should never be let near a computer, and no "idiot proof" programming language can fix these people, who have no talent, no clue, no experience.

Well that seems rather hyperbolic.

FYI, I still burn myself with the soldering iron occasionally after many years of soldering (it's always the "I'll get this done before it gets too hot to hold" trick), guess I'm just a big ol' idiot.  ;D
 

Offline jeremy

  • Super Contributor
  • ***
  • Posts: 1079
  • Country: au
Re: nimrod, new language, interesting compiler/interpreter
« Reply #43 on: September 23, 2013, 12:39:07 pm »
I think the only new programming language that will be available on a wide variety of low-end MCUs (MCUs incapable of hosting Linux, for example) for the next 5 to 10 years is going to be C++11.

I agree, but I wonder if such low end MCUs will be around in a decade? I can get an M0 for less than a chocolate bar and they are definitely capable of running uclinux.
 

Offline mrflibble

  • Super Contributor
  • ***
  • Posts: 2051
  • Country: nl
Re: nimrod, new language, interesting compiler/interpreter
« Reply #44 on: September 23, 2013, 12:42:31 pm »
Code: [Select]
if (success != 0)
    errno = -1;
    return errno;
errno = 0;
When will the last line be executed? ;)

Never. In fact, not a single line from that code will ever be executed because the author wouldn't be able to find the kompail button.
 

Offline jancumps

  • Supporter
  • ****
  • Posts: 1272
  • Country: be
  • New Low
Re: nimrod, new language, interesting compiler/interpreter
« Reply #45 on: September 23, 2013, 12:58:03 pm »
...

FYI, I still burn myself with the soldering iron occasionally after many years of soldering (it's always the "I'll get this done before it gets too hot to hold" trick), guess I'm just a big ol' idiot.  ;D
I'm the other way around: "Think it's cooled down by now" ;D
 

Offline HackedFridgeMagnet

  • Super Contributor
  • ***
  • Posts: 2028
  • Country: au
Re: nimrod, new language, interesting compiler/interpreter
« Reply #46 on: September 23, 2013, 02:05:11 pm »
Quote
Talking of languages - if you're tired of using C,  you can always try D  http://dlang.org/overview.html  ;-)

D sounds like the best language ever. From my quick reading everything I wanted to do with c and c++, and more importantly everything I wanted taken out of c, c++.
Can you compile code for embedded? It says you can use a gcc back end. I can't see any examples?

Not sorry about the hijack, replacing the bad with the good.


 

Offline c4757p

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: nimrod, new language, interesting compiler/interpreter
« Reply #47 on: September 23, 2013, 02:19:27 pm »
I liked D when I looked at it last (about a year ago), but as for compilers, it was in a sorry state. The GCC plugin was massively out of date (IIRC only compatible with D 1.0) and the other compiler only ran on a few platforms and was closed-source.

Looks like some of that has changed now. I just downloaded the source for the main compiler, but the license terms are ambiguous. (The main license.txt says "this is not open source" and all of the individual files I've opened claim to be GPL / "Artistic license", and even some under the Boost Software License |O) The compiler comes in a 64-bit binary version now, but I'm not sure if it will actually compile a 64- bit binary.

It looks like a lot of progress has been made since then, though. I think I may take another look at this. :-+
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline MacAttak

  • Supporter
  • ****
  • Posts: 683
  • Country: us
Re: nimrod, new language, interesting compiler/interpreter
« Reply #48 on: September 24, 2013, 01:04:39 am »
Never, and the compiler will warn you.
The compiler will only warn because I happened to put a return there. Not if it was some other statement that gets inadvertently executed. Or are C compilers warning for whitespace now? ;)

No, the compiler will warn you that unreachable code was detected. The whitespace is irrelevant to the token parser. The last line in that example can never be reached, and modern compilers can detect this. And some environments will even do this within the editor before you ever try to compile (for example Resharper addon for Visual Studio).
 

Offline HackedFridgeMagnet

  • Super Contributor
  • ***
  • Posts: 2028
  • Country: au
Re: nimrod, new language, interesting compiler/interpreter
« Reply #49 on: September 24, 2013, 02:58:03 am »
Yes the compiler will normally warn of this, but sometimes if you include 3rd party libs, you max out the warnings and you can miss this.

In regards to :
if(a=b)
and the lack of braces after a conditional being ok.

I think these are a couple of cases where c got it wrong.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf