Hacker News new | past | comments | ask | show | jobs | submit login

In my opinion, Odin is the most Pascal-like language with C-like syntax.



Why not directly use a modern Pascal? What's the advantage of Odin in this respect (besides the C-like syntax)?


While it has been a number of years since I last used Pascal (Delphi 5 or Turbo Pascal before that) -- I do like the language but I find the code syntax to be bloated at times. Maybe better to say harder on the eye when looking at large source code compared to C.

Of course - modern Pascal (Free Pascal, Delphi, etc) might have evolved a lot since.

  // C
  void some_func(int a) {
    int b = a + 10;
    printf("hello %d\n", b);
  }

  { Pascal - Going by memory, so might be a tad wrong }
  procedure SomeFunc(a : Integer)
  var
    b : Integer;
  begin
    b := a + 10;
    WriteLn('hello ', b); 
  end;
I have been playing around with Odin for a little while, now. It may have been inspired by Pascal in a number of ways but it certainly isn't as cumbersome to write. I am liking the syntax much more.

  // Odin
  some_func :: proc(a : i32) {
    b := a + 10
    fmt.println("hello ", b)
  }

Like what?

The only one I can think of is Ada.


FreePascal, Delphi, Oxygene, Oberon+




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: