The Cache: Technology Expert's Forum
 
*
Welcome, Guest. Please login or register. September 22, 2019, 11:46:41 PM

Login with username, password and session length


Pages: [1]
  Print  
Author Topic: free pascal, and compiling shared apache object .so's  (Read 6054 times)
Phaėton
Lifer
*****
Offline Offline

Posts: 555


⎝⏠⏝⏠⎠


View Profile
« on: October 05, 2010, 03:40:25 PM »

Oh man i wish i had some time to play with this:

http://wiki.lazarus.freepascal.org/FPC_and_Apache_Modules#Advantages_of_writing_a_Apache_module_on_Free_Pascal

Logged

When I was your age we used to walk to the TV to change the channel....  _̴ı̴̴̡̡̡ ̡͌l̡̡̡ ̡͌l̡*̡̡ ̴̡ı̴̴̡ ̡̡͡|̲̲̲͡͡͡ ̲▫̲͡ ̲̲̲͡͡π̲̲͡͡ ̲̲͡▫̲̲͡͡ ̲|̡̡̡ ̡ ̴̡ı̴̡̡
Phaėton
Lifer
*****
Offline Offline

Posts: 555


⎝⏠⏝⏠⎠


View Profile
« Reply #1 on: October 05, 2010, 03:43:23 PM »

Code:
library mod_hello;
 
uses httpd;
 
var
 hello_module: module; {$ifdef Unix} public name 'hello_module'; {$endif}
 default_module_ptr: Pmodule;
 
{$ifdef Win32}
exports
 hello_module name 'hello_module';
{$endif}
 
begin
  default_module_ptr := @hello_module;
  FillChar(default_module_ptr^, SizeOf(default_module_ptr^), 0);
  with default_module_ptr^ do
  begin
    version := MODULE_MAGIC_NUMBER_MAJOR;
    minor_version := MODULE_MAGIC_NUMBER_MINOR;
    module_index := -1;
    name := 'mod_hello.so';
    magic := MODULE_MAGIC_COOKIE;
  end;
end.
Logged

When I was your age we used to walk to the TV to change the channel....  _̴ı̴̴̡̡̡ ̡͌l̡̡̡ ̡͌l̡*̡̡ ̴̡ı̴̴̡ ̡̡͡|̲̲̲͡͡͡ ̲▫̲͡ ̲̲̲͡͡π̲̲͡͡ ̲̲͡▫̲̲͡͡ ̲|̡̡̡ ̡ ̴̡ı̴̡̡
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #2 on: October 05, 2010, 03:45:36 PM »

Wordy,  but I still really enjoy that language. The Kylix app was perfect for it as well. Didn't even need to do what you have there, because the project templates built all of that for you.

Produced some damn fast code as well.
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
nop_90
Global Moderator
Lifer
*****
Offline Offline

Posts: 2203


View Profile
« Reply #3 on: January 21, 2011, 04:26:44 PM »

Using free pascal for a different project.
I used delphi way back when.
Little things about pascal that make it better then C/C++.
Subfunctions and on windoze strings.
Problem with C++ std lib is the strings do not map properly to windows strings so you end up converting etc.

But code from free pascal is very similar to output from GCC.

Logged
Phaėton
Lifer
*****
Offline Offline

Posts: 555


⎝⏠⏝⏠⎠


View Profile
« Reply #4 on: January 21, 2011, 11:59:32 PM »

Using free pascal for a different project.
I used delphi way back when.
Little things about pascal that make it better then C/C++.
Subfunctions and on windoze strings.
Problem with C++ std lib is the strings do not map properly to windows strings so you end up converting etc.

But code from free pascal is very similar to output from GCC.



clicks 'like' ... what are you developing?   keep us posted!
Logged

When I was your age we used to walk to the TV to change the channel....  _̴ı̴̴̡̡̡ ̡͌l̡̡̡ ̡͌l̡*̡̡ ̴̡ı̴̴̡ ̡̡͡|̲̲̲͡͡͡ ̲▫̲͡ ̲̲̲͡͡π̲̲͡͡ ̲̲͡▫̲̲͡͡ ̲|̡̡̡ ̡ ̴̡ı̴̡̡
perkiset
Olde World Hacker
Administrator
Lifer
*****
Offline Offline

Posts: 10096



View Profile
« Reply #5 on: January 22, 2011, 11:06:47 AM »

It's true - especially the Borland compiler - created assembly that looked very similar to C[&++]. I just had to do a bunch of work in some old code and yet again I so enjoyed it.

Object Pascal is a pretty sweet language if you don't mind typing (which I really don't). And the early bind, highly structured nature of it makes it so that I code with very few mistakes. So long as I think a bit before my fingers hit the keys, I believe that ObjectPascal is my best one-shot-thoughts-keys-run language.
Logged

It is now believed, that after having lived in one compound with 3 wives and never leaving the house for 5 years, Bin Laden called the U.S. Navy Seals himself.
nop_90
Global Moderator
Lifer
*****
Offline Offline

Posts: 2203


View Profile
« Reply #6 on: January 22, 2011, 03:17:41 PM »

I played with pascal ages ago.
Main reason I switched to python, was python was free, and there are times when dynamic binding is better then static.

For shit like shared libraries / dll, you only really have 2 practical options, C/C++ or pascal.
Main problem with other languages including C++ is the runtime. FreePascal/Delphi compile the runtime statically.


Anyway I need to make a dll, I might port it over to C when I am finished I will think about it.
Logged
Phaėton
Lifer
*****
Offline Offline

Posts: 555


⎝⏠⏝⏠⎠


View Profile
« Reply #7 on: January 23, 2011, 08:40:06 PM »

Not that I wasnt distracted in the first place but you cant say this isnt pretty cool:

http://www.onlinecompiler.net/pascal.html
Logged

When I was your age we used to walk to the TV to change the channel....  _̴ı̴̴̡̡̡ ̡͌l̡̡̡ ̡͌l̡*̡̡ ̴̡ı̴̴̡ ̡̡͡|̲̲̲͡͡͡ ̲▫̲͡ ̲̲̲͡͡π̲̲͡͡ ̲̲͡▫̲̲͡͡ ̲|̡̡̡ ̡ ̴̡ı̴̡̡
Pages: [1]
  Print  
 
Jump to:  

Perkiset's Place Home   Best of The Cache   phpMyIDE: MySQL Stored Procedures, Functions & Triggers
Politics @ Perkiset's   Pinkhat's Perspective   
cache
mart
coder
programmers
ajax
php
javascript
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS!