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

0 Members and 1 Guest are viewing this topic.

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
nimrod, new language, interesting compiler/interpreter
« on: September 22, 2013, 03:07:52 am »
nimrod appears as a mashup between python and pascal, pretty cool, let's have a see !

i am discussing about any usage in micro controller.
 

Offline Bored@Work

  • Super Contributor
  • ***
  • Posts: 3932
  • Country: 00
Re: nimrod, new language, interesting compiler/interpreter
« Reply #1 on: September 22, 2013, 06:44:15 am »
Excuse me while I yawn.

The last thing the world needs is another programming language. Especially not the "me too" kind.
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 jancumps

  • Supporter
  • ****
  • Posts: 1272
  • Country: be
  • New Low
Re: nimrod, new language, interesting compiler/interpreter
« Reply #2 on: September 22, 2013, 07:09:09 am »
So the number of blanks at the beginning of a line have a meaning in nimrod  :o
 

Offline BravoV

  • Super Contributor
  • ***
  • Posts: 7547
  • Country: 00
  • +++ ATH1
Re: nimrod, new language, interesting compiler/interpreter
« Reply #3 on: September 22, 2013, 07:44:18 am »
Any reasons why we should even consider it ? Please, not just because its hip, new & cool.
« Last Edit: September 22, 2013, 07:54:42 am by BravoV »
 

Offline AndreasF

  • Frequent Contributor
  • **
  • Posts: 251
  • Country: gb
    • mind-dump.net
Re: nimrod, new language, interesting compiler/interpreter
« Reply #4 on: September 22, 2013, 08:33:59 am »
Quote
Native code generation (currently via compilation to C)...

So, it sounds like just another higher-level abstraction on top of C. I agree with the others: it doesn't sound very useful (yet).
my random ramblings mind-dump.net
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: nimrod, new language, interesting compiler/interpreter
« Reply #5 on: September 22, 2013, 12:58:54 pm »
it is elegant and well defined about the grammar, two things in where C is lacking a lot!
 

Offline mrflibble

  • Super Contributor
  • ***
  • Posts: 2051
  • Country: nl
Re: nimrod, new language, interesting compiler/interpreter
« Reply #6 on: September 22, 2013, 02:33:51 pm »
This looks awesome! Time to take action now and ... mark it down in the agenda to take another look in 5 years or so.

I mean over many years python managed to get from WTF-are-they-thinking  to  Not-great-but-usable. So maybe nimrod can do the same. From what I gathered from the FAQ + quick scan of docs the current state is ... meh, come back in 5 years.

If you currently happen to be looking for something better than C for embedded, just use C++. That at least takes care of some of the "C is not elegant enough"...
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 8240
Re: nimrod, new language, interesting compiler/interpreter
« Reply #7 on: September 22, 2013, 02:44:21 pm »
So the number of blanks at the beginning of a line have a meaning in nimrod  :o
Even for the comments... :o

And as for the name... it doesn't exactly inspire confidence.
 

Offline c4757p

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: nimrod, new language, interesting compiler/interpreter
« Reply #8 on: September 22, 2013, 03:07:43 pm »
it is elegant and well defined about the grammar, two things in where C is lacking a lot!

The former is subjective and the latter is false.
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline andyturk

  • Frequent Contributor
  • **
  • Posts: 895
  • Country: us
Re: nimrod, new language, interesting compiler/interpreter
« Reply #9 on: September 22, 2013, 03:27:56 pm »
... over many years python managed to get from WTF-are-they-thinking  to  Not-great-but-usable. So maybe nimrod can do the same.
Looks like nimrod is yet another untyped scripting language that's sensitive to indentation. Yuck! I thought the programming world learned the lesson that tabs/spaces shouldn't be significant decades ago (e.g., FORTRAN, Make, etc.). I blame Python for spreading the whitespace disease.
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: nimrod, new language, interesting compiler/interpreter
« Reply #10 on: September 22, 2013, 03:28:52 pm »
false ? C has an ugly grammar

e.g.

if (a=2) // instead of if(a==2)
{
}

this is horrible, and may cause a lot of troubles !

switch (ch)
{
case a:
// break;
case b:
break
}

the missing of a break may be a mistake and may cause a lot of troubles

etc etc

too ugly grammar, not safe at all, and this is the reason why you'd go for Misra checker !
 

Offline c4757p

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: nimrod, new language, interesting compiler/interpreter
« Reply #11 on: September 22, 2013, 03:34:16 pm »
Ugly? Maybe. I really like it.

But not well defined? Horseshit. And that's the part I said was false.

I fail to see what's wrong with any of those.

Code: [Select]
if (a=2) {}

Yep, you're setting 'a' equal to two, then using it as a Boolean. What's hard about that? I'd say "not well defined" would be using the same damn operator for comparison and assignment. And modern compilers will complain about that with warnings turned on, as anybody who has no delusions of being a macho man-coder will have done.

Code: [Select]
switch (ch)
{
case a:
// break;
case b:
break
}

Again, perfectly consistent. The "case" lines are labels, not blocks, you jump to them and then keep going. The only way you'd be prone to leaving out 'break' is if you don't understand that they are labels. And if you don't understand the language, of course you'll screw it up. If you want blocks instead of labels, you're free to use the if/else-if chains that are used in Python.
« Last Edit: September 22, 2013, 03:35:53 pm by c4757p »
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline sleemanj

  • Super Contributor
  • ***
  • Posts: 3020
  • Country: nz
  • Professional tightwad.
    • The electronics hobby components I sell.
Re: nimrod, new language, interesting compiler/interpreter
« Reply #12 on: September 22, 2013, 03:59:31 pm »
I blame Python for spreading the whitespace disease.

It's quite a shame really, if Python had brace denoted blocks rather than the silly whitespace is important, I think it could have really been a lot more successful, it is not a too bad language as I recall, apart from the bloody whitespace.

As for nimrod... I don't really see a place for it.  Especially not in microcontrollers.

There is absolutely a market there for a higher level (or perhaps simply better) language than C/C++ that could be used in the tight confines of microcontrollers, but this ain't it. 
~~~
EEVBlog Members - get yourself 10% discount off all my electronic components for sale just use the Buy Direct links and use Coupon Code "eevblog" during checkout.  Shipping from New Zealand, international orders welcome :-)
 

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 8515
  • Country: us
    • SiliconValleyGarage
Re: nimrod, new language, interesting compiler/interpreter
« Reply #13 on: September 22, 2013, 04:02:10 pm »
Sensitive to indentation ? Will somebody shoot it please before it spreads like pestulence ?
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline mrflibble

  • Super Contributor
  • ***
  • Posts: 2051
  • Country: nl
Re: nimrod, new language, interesting compiler/interpreter
« Reply #14 on: September 22, 2013, 04:13:29 pm »
Looks like nimrod is yet another untyped scripting language that's sensitive to indentation. Yuck! I thought the programming world learned the lesson that tabs/spaces shouldn't be significant decades ago (e.g., FORTRAN, Make, etc.). I blame Python for spreading the whitespace disease.

Heh, you just touched on pet peeve #1 regarding Python. Many many moons ago when I wrote my first Makefile it didn't work.. check it... mmmh, looks right. Check it again.... wtf? it really seems to be right?!? Oh surely not? Check a working example .... mmmmh, that has tabs in in, I used spaces. Naaaaaaah, that can't be it... But just to be sure, lets replace with tabs. GNNNNN with tabs it's working.  :wtf:  :wtf:  :wtf: Okay, where's the lynch mob? I wanna join!  :box:

And then years later Python comes along and does the same thing. BAM! Instant dislike! And the language features + lack of libs at the time didn't really motivate to use it either. So screw that. Only fairly recently I had reason to check out Python again. Alright, enough libs + other stuff around to make it doable. I still thoroughly despise the F-ing indentation as language construct though.
 

Offline c4757p

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: nimrod, new language, interesting compiler/interpreter
« Reply #15 on: September 22, 2013, 04:18:57 pm »
I actually really like Python for quick, script-y things, but I'd definitely like it a bit more without the stupid indentation thing.

At least the indentation rules aren't completely bizarre. Generally, just following "standard" indenting conventions will produce valid Python.
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline vvanders

  • Regular Contributor
  • *
  • Posts: 124
Re: nimrod, new language, interesting compiler/interpreter
« Reply #16 on: September 22, 2013, 04:37:01 pm »
Not really understanding the Python hate, just set your editor to insert spaces as tabs @ 4 spaces and I've never had any issues. I actually like the whitespace because it forces consistency which is more important to me than whatever coding standards you are using.

Of all the scripting languages I've found I like python the most(although Lua has a special place in my heart for being so compact and bloody fast for a scripting language).
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: nimrod, new language, interesting compiler/interpreter
« Reply #17 on: September 22, 2013, 04:44:11 pm »
I am a C programmer but i do not like C, i use it just cause i have no other language.

i use
- SierraC for 68000 (it is C89, very old but prettier than gcc-m68k)
- AnalogDevices VisualDSP++ C for Blackfin
- SGI MIPS PRO C/C++ for IRIX
- Cosmic C for 683xx and 68hc11 (it runs on XP and it has Misra checker plugin)
- SONY PSX Gcc
- MIPS.SDE C, for MIPS32
- KEIL ucVision C/C++ for Arm
- MPLAB C for dsPIC
- gcc for powerpc, super hitachi, x86

i have modula2/3 (based on gcc) ables to crosscompile for
- host=x86, target=PowerPC
- host=x86, target=arm (nintendo GBA)
- host=x86, target=avr8

i have freePascal ables to crosscompile for
- host=x86, target=PowerPC
- host=x86, target=arm (nintendo GBA)

i have green hills ADA
- host=x86/linux, target=PowerPC
- host=sparc/sunOS, target=PowerPC

i have gnat-ADA able to compile for
- host={x86, PowerPC, Arm}

ADA for 68hc11/Avr8 has no sense and gnat is broken for the most


so that's all, no other compilers languages, just C/C++!
may be i can use eLUA as interpreter, it is working on Discovery ARM board, for example, or python on chip, which is working on the same board, but they are interpreters not compilers!

Yep, you're setting 'a' equal to two, then using it as a Boolean. What's hard about that?

that is terrible at all, no sense to admit a "LET" (a=...) inside a conditional statement, it is just a reason to put a bug inside your code if you miss a char "="  !
A LET MUST stay OUTSIDE and end with ";", and a conditional statement MUST be eval-boolean-expression, so it MUST refuse everything does not result as a boolean {True, False}

The only way you'd be prone to leaving out 'break' is if you don't understand that they are labels.

It may be you forget it, it happens when you copy & past, or when you are tired and you miss a piece of code: a pretty compiler should warning or point attention to it! A break is also dangerous cause it may be used to escape a block, while (eval) { blabla; break; } and this cause people to abuse of it producing ugly code.
 

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 8515
  • Country: us
    • SiliconValleyGarage
Re: nimrod, new language, interesting compiler/interpreter
« Reply #18 on: September 22, 2013, 04:49:07 pm »
Not really understanding the Python hate, just set your editor to insert spaces as tabs @ 4 spaces and I've never had any issues. I actually like the whitespace because it forces consistency which is more important to me than whatever coding standards you are using.

Of all the scripting languages I've found I like python the most(although Lua has a special place in my heart for being so compact and bloody fast for a scripting language).
until you copy and paste a chunk of code sends it via email and the tabs get converted to spaces....

or someone touched the code and inserted 1 space somewhere and it is not really obvious and you bang your head out chasing why it doesn't work and it used to.

whitespace is whitespace . it should not be a part of the programming syntax.
Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline mrflibble

  • Super Contributor
  • ***
  • Posts: 2051
  • Country: nl
Re: nimrod, new language, interesting compiler/interpreter
« Reply #19 on: September 22, 2013, 05:16:33 pm »
Not really understanding the Python hate ...
whitespace is whitespace . it should not be a part of the programming syntax.

This.
 

Offline Bored@Work

  • Super Contributor
  • ***
  • Posts: 3932
  • Country: 00
Re: nimrod, new language, interesting compiler/interpreter
« Reply #20 on: September 22, 2013, 07:02:13 pm »
A LET MUST stay OUTSIDE

Who says this? And who-tf says that a LET keyword is a good idea?

Quote
a conditional statement MUST be eval-boolean-expression, so it MUST refuse everything does not result as a boolean {True, False}

Who says this?

Quote
while (eval) { blabla; break; } and this cause people to abuse of it producing ugly code.

Who says this?
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 legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: nimrod, new language, interesting compiler/interpreter
« Reply #21 on: September 22, 2013, 07:22:52 pm »
Who said that ?
Misra, for example, giving suggestions to build/fix languages in order to avoid ugly (and probably bugged) code.
C is so ugly that requires a Misra-C checker in post process, so as soon as you have finished to code you C source code you have to check if it pass the Misra check: too ugly, too boring, (too expensive, a Misra checker like QAC is not for cheap), a language MUST be safe, stronger, and beauty by design!

Also, have a look at ADA language, see the reasons why they did ADA in such a stronger-way.
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: nimrod, new language, interesting compiler/interpreter
« Reply #22 on: September 22, 2013, 07:29:58 pm »
anyway, i've planned to give nimrod a try: probably i will use it in a bare board MIPS32-r1 board, and in a linux MIPS SoC board.
I am curious about the C code that nimrod can produce! It may be good and productive enough to switch development into nimrod.

let's have a try, too! it may be fun!
 

Offline mrflibble

  • Super Contributor
  • ***
  • Posts: 2051
  • Country: nl
Re: nimrod, new language, interesting compiler/interpreter
« Reply #23 on: September 22, 2013, 07:33:59 pm »
A LET MUST stay OUTSIDE

Who says this? And who-tf says that a LET keyword is a good idea?

I think he means LET as "evaluate right hand side, and then assign this value to left hand side", not as a language literal.

And to be fair, the if (a=b) {  versus  if (a==b) { is sneaky and can be a fun source of bugs when you don't watch it. The argument about case and forgetting breaks ... nope, you lost me there. I never ever EVER forget about breaks or a default statement. Just do case statement in verilog for a while and your brain will not even allow you to entertain the possibility of maybe possibly making a tiny error in a case statement. EVER. AGAIN.

let's have a try, too! it may be fun!

That is soooo several hours ago. I already checked it to see if it throws an error/warning for the if (a=b) { statement. And yes, it throws an error. Expression has no type or is ambigious. It even caught my sneakier attempts. :P
 

Offline andyturk

  • Frequent Contributor
  • **
  • Posts: 895
  • Country: us
Re: nimrod, new language, interesting compiler/interpreter
« Reply #24 on: September 22, 2013, 07:40:46 pm »
Also, have a look at ADA language, see the reasons why they did ADA in such a stronger-way.
Wait. What? ADA is a failure. Many gov't organizations mandated the use of ADA, but coders never went for it. C won (over ADA, Pascal, etc.) because more people used it to write programs, warts and all.

ADA just wasn't that useful.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf