flat assembler
Message board for the users of flat assembler.

Index > Heap > Do you use Free Pascal?

Goto page 1, 2  Next
Author
Thread Post new topic Reply to topic
OzzY



Joined: 19 Sep 2003
Posts: 1029
Location: Everywhere
OzzY
I just had this thinking recently... why pascal isn't used a lot like C++?
What is Pascal really missing?

I don't think a language is slow by itself. I think compiler implementations make slow/fast code.
Free Pascal looks very powerful. And runs on many platforms.
But no one seems to care.

I used to hate pascal, because it has less flexibility than C/C++.
But thinking better Pascal seems to have cleaner syntax, and doesn't require ugly things as casts.

What do you think of Free Pascal and Lazarus projects?
Post 19 Aug 2007, 21:28
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
FreePascal? Well, bugged a lot and very unoptimized output. Try setting the maximun optimization level and then checking it with a dissasembler (or just with OllyDbg), you'll see how even it sucks to do decent register allocation.

What I don't understand is why them didn't use gcc as base code, FreePascal is GNU and gcc obviously too so the FreePascal team decided to implement the compiler from scratch only because they wanted...
Post 19 Aug 2007, 23:04
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
Pascal is the best high level language there is, but freepascal as LocoDeiAssembly said, is not a good example.
Turbo pascal was much better, if there was a pascal that used fasm for its backend, that would be cool.
Post 20 Aug 2007, 01:28
View user's profile Send private message Reply with quote
ManOfSteel



Joined: 02 Feb 2005
Posts: 1154
ManOfSteel
@Dex4u:
Quote:
if there was a pascal that used fasm for its backend

What do you mean by that?
Post 20 Aug 2007, 05:59
View user's profile Send private message Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1901
DOS386
> > was a pascal that used fasm for its backend
> What do you mean by that?

Isn't it obvious ?

1. PASCAL -> FASM
2. FASM -> binary

> Turbo pascal was much better

CRAP. Sad Error-200-bug, lack of unsigned integers, no 32-bit DOS, ...

> if there was a pascal that used fasm for its backend, that would be cool.

Agree Wink With DPMI32 and DexOS targets Wink

> FreePascal? Well, bugged

VERY true Sad

> a lot and very unoptimized output. Try setting the maximun optimization level and then checking it with a dissasembler (or just with OllyDbg), you'll see how even it sucks to do decent register allocation.

And bloated itself ... devels officially never cared about this ... Hint: just buy a bigger HD Laughing

> What I don't understand is why them didn't use gcc as base code, FreePascal is GNU and gcc obviously too so the FreePascal team decided to implement the compiler from scratch only because they wanted...

Very well reproductable. PASCAL would look as a crap language if one had to translate it to C first ... and would slow down the compilation ... and bloat the compiler ... so they don't use GCC ... but bloated the compiler nevertheless ... and PASCAL died nevertheless Sad

Quote:
I just had this thinking recently... why pascal isn't used a lot like C++?
What is Pascal really missing?

I don't think a language is slow by itself. I think compiler implementations make slow/fast code.
Free Pascal looks very powerful. And runs on many platforms.
But no one seems to care.


Very true. Even worse, nowadays one " must " translate PASCAL to C before releasing into open source Confused
Post 20 Aug 2007, 22:51
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
let's clarify what exactly we mean by "pascal". Does object-oriented delphi stuff count?
Post 20 Aug 2007, 23:52
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1901
DOS386
vid triple-posted:

Quote:
let's clarify what exactly we mean by "pascal". Does object-oriented delphi stuff count?


0. YES. IIRC since TP 5.0.
1. Forum seems to dislike vid as well (was slow as hell ? for me too !!!) Laughing
2. Let's see whether vid cleans up his multipositng at least Confused
Post 21 Aug 2007, 07:22
View user's profile Send private message Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
0: okay. So is pascal's object-oriented syntax standardized somehow, or is it just dependent on compiler vendor?

1: yes, forum "dislikes" me too, but that was not the case. problem is that my internet connection dislikes me even more these days.

2: what if i wouldn't? i fail to see reason for that irony.
Post 21 Aug 2007, 09:13
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
ManOfSteel



Joined: 02 Feb 2005
Posts: 1154
ManOfSteel
@NTOSKRNL_VXE,
Quote:

Isn't it obvious ?

1. PASCAL -> FASM
2. FASM -> binary

Ok, but what does this mean in computer terms? Does it mean pascal code is translated by the pascal compiler into asm, which is then assembled by fasm? That's what I'm asking.
Also, is there such a thing outside theory (between pascal and asm or any other programming languages)? Could you give examples?
Post 21 Aug 2007, 11:22
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
ManOfSteel wrote:
@NTOSKRNL_VXE,
Quote:

Isn't it obvious ?

1. PASCAL -> FASM
2. FASM -> binary

Ok, but what does this mean in computer terms? Does it mean pascal code is translated by the pascal compiler into asm, which is then assembled by fasm? That's what I'm asking.
Also, is there such a thing outside theory (between pascal and asm or any other programming languages)? Could you give examples?


Yes.

Several compilers also use FASM as a backend:

PureBasic
HLA (High Level Assembly)
BlitzMax
Context/Win32
B0

If you take a look at BP RTL as a example, you will see that most commands are just wraps for TASM code.
Go here: http://alexfru.narod.ru/emiscdocs.html
And get bp7rtl.zip "RTL sources for BP 7.0" and you will see how important TASM was to TP and BP.

@NTOSKRNL_VXE, take alook here: http://freenet-homepage.de/dieterp/
At "Dpass"
Post 21 Aug 2007, 18:46
View user's profile Send private message Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1901
DOS386
Quote:
XE, take alook here: http://freenet-homepage.de/dieterp/
At "Dpass"


COOL. Does it work well ? Is it a serious compiler or just another toy compiler ? Confused

Quote:
Also, is there such a thing outside theory (between pascal and asm or any other programming languages)? Could you give examples?


YES. FPC, FBC and GCC always compile via GAS. CC386 optionally compiles via NASM. Idea

There is a nice thread about this issue:

http://board.flatassembler.net/topic.php?t=6631
Post 22 Aug 2007, 07:36
View user's profile Send private message Reply with quote
ManOfSteel



Joined: 02 Feb 2005
Posts: 1154
ManOfSteel
Thank you both for clarifying.
I found nothing about B0. What is it? Where can I find more about it?
Post 22 Aug 2007, 11:15
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
NTOSKRNL_VXE wrote:
Quote:
XE, take alook here: http://freenet-homepage.de/dieterp/
At "Dpass"

COOL. Does it work well ? Is it a serious compiler or just another toy compiler ? Confused
I remember using it some time ago seem to work well, got good doc too.
ManOfSteel wrote:
Thank you both for clarifying.
I found nothing about B0. What is it? Where can I find more about it?

http://chewy509.atspace.com/b0.html
Post 23 Aug 2007, 16:30
View user's profile Send private message Reply with quote
ManOfSteel



Joined: 02 Feb 2005
Posts: 1154
ManOfSteel
@Dex4u:
Quote:
http://chewy509.atspace.com/b0.html

I already knew this URL. Unfortunately it seems to be down. I hoped there would be another website.
So, is B0 compiler free? Does it have its own syntax or is it based on a exiting one (eg: BASIC)?
Post 24 Aug 2007, 06:14
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
The site is up for me, just incase here is the main page
Quote:

B0


Copyright © 2000-2007, Darran Kartaschew


Introduction


The B0 language and compiler came about during an effort to create my own Operating System. The main problem faced, was the C was too high level, and coding in assembler was a pain (even though 80% of my code is pure asm, and the other 20% is PHP for work).


Being soley an assembler programmer for many years gave me a pure unrestricted environment to play in, rather than being locked down to a particular environment. Which always left a bad taste in my mouth, whenever I worked with many of the HLLs out there, (ever tried a bitwise rotate in C?). I wanted the freedom that assembler gave me, but have a HLL programming style.


I looked Randall Hyde's HLA, and while the syntax is more HLL programmer friendly, it still didn't gel with me. Plus I was limited to a particular OS (Windows or Linux), becuase of the standard library it used. (Which by the way is a great library, just doesn't suit my needs as it stands).


At first B0, may look like C, but once you get down and dirty, you quickly realise that it's not a bastardised C clone, but something else. The best way I would describe it, is a HLL designed to be machine dependent based a 64bit architecture.


A quick word on licensing: The B0 language and this implementation are released under a BSD license.


System Requirements

Either a IA-32 w/EM64T or AMD64 based processor, for 64bit Operation.
Minimum 512MB of RAM (The compiler requires approximately 140MB when compiling applications).
64bit OS. (Any with a C compiler, and somewhat basic libc support).
FASM v1.65.13+ (used as a backend assembler - Hi Tomasz).
Text Editor supporting UTF-8 (Unicode Output).

Code Example


//Program 'Hello World';
lib 'stdlib.b0';
proc main(){
r0 = &'Hello World?\n';
echo(r0); //echo() prints the string pointed to by r0 to stdout
exit(r0);
};


The always present 'Hello World?' example.


Unfortunately, this little example doesn't give away that much...


As you can see, it looks a lot like C and quite a few other languages. But the make up of each statement is very simple, and in most cases match the assembler output nearly 1:1.


Hopefully some of the other code snippets will highlight this.


What makes it different from other languages


Nothing really, except that it's very minimalist and you get to play with the CPU registers within the acutal code itself. (The code focuses around the registers).


Is it Assembler or a High Level Language, or both?


Well that depends on your view of things. It's assembler, since it provides near 1:1 correspondance to actual machine instructions, but it's HLL since the code is constructed as a HLL.


It's a debate that I don't want to get into, but you may even want to call it a HLA (High Level Assembler), but I wouldn't go that far. Personally I believe it's a hybrid, or a machine dependant HLL. On the generation scale, eg 1GL (straight hex), 2GL (assembler), 3GL (HLL), 4GL (VHLL/Natural), I would place it about 2.9GL.


What's Supported


Here is a quick list of the current programetic support:

variable declarations (any location within code).
array declarations.
procedures, with inline parameter passing.
if-then, if-then-else and while-do C style constructs.
Inclusion of other files. (lib keyword).
pointer assignment, and global pointer access. (both simple and complex pointers).
unsigned integer and bitwise operations (add, sub, mul, div, mod, and, not, xor, or, shifts, rotates, neg).
signed integer operations (mul, div, mod).
floating point math operations. (add, sub, mul, div, neg).
inline assembler. (Pass through to backend assembler).
direct calling of OS API (via syscall keyword).
symbol definitions (equates) and conditional compilation support.
Support for structures.

What's NOT supported (and most likely never will)


Here is a quick list of stuff is isn't currently supported, and most likely never will be:

Compound operations.
Logical boolean operations.
Direct variable -> variable operations.

These are simple too high level...


Future Plans


The current future plans or to-do list include:

Support for SIMD operations*.
Basic Macro Support.
Basic IDE for *nix and Windows (a LONG way off).

* These are already available via inline asm.


Downloads


B0 v0.0.20 Manual: HTML


B0 v0.0.20 Source (tar.bz2): b0.tar.bz2 (md5 = 5acaaadbb7682a0d67dd43c5dd88f01e )


B0 v0.0.20 Source (zip): b0.zip (md5 = def5717f056f7f0f413f1acd15fa55c5 )


B0 v0.0.20 Windows Installer: Email me


B0 Compiler Internals Document: HTML (Note: This covers v0.0.6 of the compiler).


B0 Version History: HTML.


B0 Tutorial: HTML.


Contact Me


I'm reachable at "Chewy509 at mailcity dot com" and be sure to include 'b0' in the subject line, otherwise it goes straight into the trash.


Post 24 Aug 2007, 16:06
View user's profile Send private message Reply with quote
Embrance



Joined: 14 Mar 2004
Posts: 116
Location: Greece
Embrance
First let me say why Pascal isnt the known:
1)All my teachers in university teach the students that Pascal is a kid language.That sit cant do most of the stuff other languages can,something thats a lie.See FPC list of features and and find one thing it cant do.
2)Lack of up to date docs and examples.I myself was looking for something that would work(a good gfx unit)but what avalaible is units with a hell of useless functions,no docs,and 90% of the time they dont work for x,y,z reasons.If you ask for help even on bigger known sites,you will probably get 0 reply and if you get they will suggest you things like changing you units,software,compiler whatever other than actually helping you.
3)People rarely share their source code for other people to use it.I dont know wtf they are thinking of(maybe they think themselves l33t or something)...
------------------
I like Pascal,I like Basic,but I believe that ASM is the way to go,as there is nothing you cant achieve with it,and i would say C is a good choice for me as well.
Post 25 Aug 2007, 19:35
View user's profile Send private message MSN Messenger ICQ Number Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo
FPC is supposedly very very good (and portable), and it does many things other Pascals don't, so you can't knock it.

TP 5.5 is free and good (for 16-bit DOS stuff, at least).

Nobody here has mentioned the obvious alternative: GNU Pascal
Post 29 Aug 2007, 00:31
View user's profile Send private message Visit poster's website Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1901
DOS386
> FPC is supposedly very very good (and portable)

Did you bother to test ? If you are a PASCAL expert, please fix the criminal memory allocation bug making Blocek unusable Sad

> TP 5.5 is free and good (for 16-bit DOS stuff, at least).

Have not yet seen a well working thing written in TP Confused

> Nobody here has mentioned the obvious alternative: GNU Pascal

OK ... does it work well for you ? Any users / applications ?

There is VirtualPASCAL ... maybe good if you know how to use ... and tolerate the bloat Wink
Post 29 Aug 2007, 05:43
View user's profile Send private message Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u
NTOSKRNL_VXE wrote:
Have not yet seen a well working thing written in TP Confused

What about this great mario game http://home.wxs.nl/~mikewiering/msrc/
Even runs on buggy FreeDos Wink.

I agree with you about freepascal, but turbo pascal is the best higher level compiler, and 1000's of great software has been coded with it.
Post 29 Aug 2007, 15:51
View user's profile Send private message Reply with quote
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo
NTOSKRNL_VXE wrote:
> FPC is supposedly very very good (and portable)

Did you bother to test ? If you are a PASCAL expert, please fix the criminal memory allocation bug making Blocek unusable Sad


No, I don't actively use it, but it sounds so damn impressive (compatibility, portability) that I have downloaded it, at least. A few bugs exist in everything (and we NEED competition in programming languages, I'm tired of the same 'ol same 'ol). Wink

NTOSKRNL_VXE wrote:

> TP 5.5 is free and good (for 16-bit DOS stuff, at least).

Have not yet seen a well working thing written in TP Confused


How about Snake_VR? Laughing

NTOSKRNL_VXE wrote:

> Nobody here has mentioned the obvious alternative: GNU Pascal

OK ... does it work well for you ? Any users / applications ?


Works great, very nice compiler (IMO) with good docs, examples, etc. I should mention that I dunno Pascal AT ALL, just a fan of compilers and languages in general. Cool

EDIT: NTOSKRNL_VXE, they all run in DOS! So, how bad could they be?? Laughing
Post 30 Aug 2007, 03:09
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page 1, 2  Next

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.