Chaosforge Forum

  • April 24, 2024, 23:44
  • Welcome, Guest
Please login or register.



Login with username, password and session length
Pages: [1]

Author Topic: Free Pascal  (Read 6224 times)

Titt

  • Sergeant
  • *
  • Offline Offline
  • Posts: 69
    • View Profile
Free Pascal
« on: July 06, 2008, 10:53 »

As far as I know, all of Kornel's roguelike projects are written in Free Pascal. I have always heard serious programmers talk about Pascal as being sort of a "toy" language, like BASIC, but I assumed Kornel was just most familiar with Pascal so it was most comfortable and effective for him to use it. So it surprised me to see that Free Pascal does very well in the programming language benchmarks shootout. Here is its comparison to gcc, the GNU C compiler, one of the tightest compilers for any language, ever, and Free Pascal does only marginally worse on CPU time for most benchmarks, and noticeably better on memory use. Weighing CPU time, memory use, and program size with equal weights, Free Pascal does better than all other compilers in all other languages.

These benchmarks are highly artificial and definitely don't take into account many (perhaps most) of the factors that are important in programming, but it still was a surprise to me, to see Free Pascal perform so well. Kornel, what do you use to write graphics to the screen in your roguelike projects? Is there something like curses available for Free Pascal?
Logged

ParaSait

  • Baffen :P
  • Elder
  • Lieutenant General
  • *
  • *
  • Offline Offline
  • Posts: 1229
  • Happy Little Boozer
    • View Profile
    • MPSF
Re: Free Pascal
« Reply #1 on: July 06, 2008, 13:10 »

So if I understand right, a freeware compiler is way better than a paid compiler? Weird...
Logged
[18|7|3|0|0|0] [MED:13/43] [SPE:36/67] [ASM:11/40]

Check out my epic youtube channel!
Currently playing The Bard's Tale and System Shock 2 (coop with GrAV1t)!

rekenne

  • Elder
  • First Lieutenant
  • *
  • *
  • Offline Offline
  • Posts: 200
    • View Profile
Re: Free Pascal
« Reply #2 on: July 07, 2008, 01:16 »

This is not a terribly odd thing, really.
Logged

Rabiat

  • Sergeant
  • *
  • Offline Offline
  • Posts: 98
    • View Profile
Re: Free Pascal
« Reply #3 on: July 07, 2008, 02:19 »

I don't see why Pascal would be considered a toy language by anyone who could be seen as a 'serious' programmer (whatever that is).

Also, I don't think there's a strict relation between the quality of a compiler and the language it parses.
Logged
0.9.9.2 - [22/8/2/0/0] - Mancubus Scrap Metal Collector

Jim9137

  • Rainbow Love Marine
  • Backer
  • Lance Corporal
  • *
  • *
  • Offline Offline
  • Posts: 27
    • View Profile
Re: Free Pascal
« Reply #4 on: August 27, 2008, 07:43 »

When people say "pascal is a toy" they usual refer to Turbo Pascal and other such relics from 80s.

Damn stoned junkie programmers, I DO NOT WANT.
Logged

Igor Savin

  • Elder Chaos Guard
  • Second Lieutenant
  • *
  • *
  • Offline Offline
  • Posts: 180
    • View Profile
Re: Free Pascal
« Reply #5 on: August 28, 2008, 03:31 »

/Kornel, what do you use to write graphics to the screen in your roguelike projects? Is there something like curses available for Free Pascal?/

Carefully written, hand-crafted output library, which rocks. It's part of Valkyrie - give it a shot; input-processing libraries are good too.

The only bad thing: current Valkyrie is not compatible with recent FPC 2.2.2, and I wonder if Kornel has plans for update at all.
« Last Edit: August 28, 2008, 03:34 by Igor Savin »
Logged

Rabiat

  • Sergeant
  • *
  • Offline Offline
  • Posts: 98
    • View Profile
Re: Free Pascal
« Reply #6 on: August 28, 2008, 09:08 »

When people say "pascal is a toy" they usual refer to Turbo Pascal and other such relics from 80s.

Just 'cause Turbo Pascal is old doesn't make it a toy. But I guess many programmers were introduced to programming through Pascal, and all they remember is the toy programs they wrote in it when they were noobs. Then again, Turbo Pascal never did have a standard library to speak of, which made it extremely time-consuming to create anything non-trivial in it. I don't know anything about compiler construction, but as far as I remember Borland's implementation was supposed to be decent enough in its day (as well as their C/C++ compilers).

Quote
Damn stoned junkie programmers, I DO NOT WANT.

You don't want... what, exactly? The hallucinogenics must be blocking my ability to read your mind. ;)

Carefully written, hand-crafted output library, which rocks. It's part of Valkyrie - give it a shot; input-processing libraries are good too.

FreePascal still implements the good old CRT unit, but I've been browsing parts of Valkyrie and it has a lot to offer. I think using Valkyrie could cut a roguelike's development time in half. Unfortunately, half the fun of writing a roguelike is creating my own field of view code, input processing, and display routines, and then abandoning the project for two years, because I can't come up with solid content for the life of me. ;)
Logged
0.9.9.2 - [22/8/2/0/0] - Mancubus Scrap Metal Collector

Igor Savin

  • Elder Chaos Guard
  • Second Lieutenant
  • *
  • *
  • Offline Offline
  • Posts: 180
    • View Profile
Re: Free Pascal
« Reply #7 on: August 29, 2008, 00:59 »

/FreePascal still implements the good old CRT unit/

With a difference. Default CRT output refreshes screen on every possible output done, which is awfully inefficient, slow and flickery-prone.

Valkyrie ouput is more Curses-like in this sense, as you can control, when to update the screen - which is mostly unneeded, since latest (SVN) Valkyrie uses progressive aproach to this problem - screen is updated every time player is expected to press a key, which is a rational thing to do; and should you need updates in between, you can call these easily.
Logged
Pages: [1]