JJordan
2015-02-22 10:52:27
Just wondering why SRL/Simba chose free pascal as its language.
What are its strengths compared to something like Java or C++?
What are its strengths compared to something like Java or C++?
2015-02-22 10:52:27
2015-02-22 10:53:55
2015-02-22 10:55:48
From: Hawker
So it was compatible with scar (I think)
2015-02-22 10:57:54
From: KeepBotting
One could then ask the question: why did SCAR use pascal? I don't know, maybe someone else does
2015-02-22 11:00:51
2015-02-22 11:33:34
From: Wizzup?
Simple language, Kaitnieks himself was probably used to Delphi, so Pascal was a logical step since there was an interpreter for it (PascalScript). Benefits? Well, it's not as bad as C++ and Java, and it's nice as a scripting language here. These days I would probably prefer Python, but hey. :)
2015-02-22 11:52:10
2015-02-22 11:56:05
From: the bank
SCAR was never meant to be anything serious, it was originally just a temporary replacement/side project of AutoRune.
Fact is, I don't care what anyone says, Java, C++, .NET languages…just about anything is considerably faster, more powerful, and prettier on the eyes than pascal/delphi.
2015-02-22 12:00:43
2015-02-22 12:34:10
From: the bank
Fact is, I don't care what anyone says, Java, C++, .NET languages…just about anything is considerably faster, more powerful, and prettier on the eyes than pascal/delphi.
2015-02-22 12:59:42
From: slacky
I find object pascal very nice looking.
Also, faster than Delphi? You clearly don't know much about Delphi then. Delphi is fast (it compiles to quite optimized native machine code), none of the mentioned languages are notably faster. They might in some cases be a few times faster than FPC, but FPC is not Delphi (and that's usually not noted).
I can assume you mean to say those languages (errm compilers) are much faster then Lape (not Delphi), then you wouldn't be wrong. But for what we do speed isn't really that much of a concern, when a speedup is needed you simply extend it with a "plugin" (dll), this plugin can be written in any language capable of compiling a lib.
2015-02-22 12:59:45
2015-02-22 13:05:13
From: Olly
I also think Pascal is the most easiest language to understand with no prior coding knowledge.
Obviously most languages out class it, but pascal does a decent job for RS scripts.
Also don't forget we're using a interpreter (Lape) which is far from FPC.
2015-02-22 13:15:52
From: Olly
I also think Pascal is the most easiest language to understand with no prior coding knowledge.
Obviously most languages out class it, but pascal does a decent job for RS scripts.
Also don't forget we're using a interpreter (Lape) which is far from FPC.
2015-02-22 13:59:00
From: slacky
I find object pascal very nice looking.
Also, faster than Delphi? You clearly don't know much about Delphi then.
I can assume you mean to say those languages (errm compilers) are much faster then Lape (not Delphi), then you wouldn't be wrong.
2015-02-22 14:07:37
From: the bank
I mean no disrespect, however Pascal/Delphi are ridiculously wordy languages. Not only does this, ironically, decrease readability due to the clusterfuck that is an application, but also limits efficiency of the developer by making code longer and take more time to write.
As far as Delphi compiling into machine code that is optimized anywhere near the degree of say C or C++ is ridiculous fallacy. Take these benchmarks for example. Of course these sorts of things are specific to compilers themselves, but I would put VisualStudio 2014 or even GCC faster than any Delphi compiler I've ever used.
I've used Delphi extensively, including creating the OpenSCAR project a year or so before Simba was even released. And yes, I'm well aware of Simba's plugin capability.
Delphi is fairly quick, you're correct, but it is not the fastest, and leaves a lot to be desired in terms of efficiency, specifically for the developer. Its just so damn "wordy".
2015-02-22 14:19:45
From: slacky
And all in all.. Who really needs the fastest of the fasts languages?
Any compiler that spits out machine-code is usually good enough. There are very very few cases where one actually would need to care about the microscopic speed difference between GCC and Delphi. Can you mention any? And if speed is that important in what ever you do can't you just have the most critical parts written in assembly?
Assembly in FPC and Delphi is extremely simple to use.
2015-02-22 14:30:55
From: Brandon
Yes you are right. The mentioned languages are not "much" faster naturally but the optimisation of the other languages are done a ton better.
And yes we DO need the fastest at times. We use image processing in our scripts (OpenCV doesn't use Pascal or Delphi for a reason). We read directly from the GPU in OpenGL and Direct-X. Doing this more than 30,000 per second in Pascal & Delphi is a LOT slower.
In high performance critical code, it matters. It's not just a few nano-seconds or micro-optimisation. It's seconds that are passing.
But we are arguing about scripting languages so yes, I would say you are 100% right and that it doesn't matter.. but we could have been using Python or LUA instead of Lape or PascalScript.
2015-02-22 14:35:51
From: the bank
SCAR was never meant to be anything serious, it was originally just a temporary replacement/side project of AutoRune.
Fact is, I don't care what anyone says, Java, C++, .NET languages…just about anything is considerably faster, more powerful, and prettier on the eyes than pascal/delphi.
2015-02-22 15:02:24
From: slacky
Regarding OpenCV, have look at it's code. The most critical parts are usually written as SSE2 instructions.. And, alternatively can be compiled to use your GPU (Using OpenGL).
You also mention OpenGL, I am not sure why. OpenGL can be used from any language that can do external function calls (and AFAIK they all do it pretty much the the same way) so there is no slowdown there, if you where to use OpenGL from delphi.
typedef struct _EXCEPTION_RECORD
{
DWORD ExceptionCode; // which exception occurred
DWORD ExceptionFlags; // additional exception info
struct _EXCEPTION_RECORD *ExceptionRecord;
PVOID ExceptionAddress; // where the exception occurred
DWORD NumberParameters;
ULONG_PTR ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS];
} EXCEPTION_RECORD;
Function PSAlloc(size: Integer): Pointer;
begin
Result := AllocMem(size);
end;
var
TIA: TIntegerArray;
begin
SetAllocator(@PSAlloc);
TIA := randomIntArray(0, 500, 1000); //generate 1000 random ints
end.
void (*allocator)(int) = NULL;
void SetAllocator(void (*alloc)(int))
{
allocator = alloc;
}
void* randomInt(int min, int max, int count)
{
int* TIA = (int*)allocate(count, allocator); //allocate memory using Pascal instead of C.
generate_random(TIA, min, max, count);
return TIA;
}
2015-02-22 15:14:28
From: Brandon
Ahh you're being stubborn. OpenGL can be used in any language such as Pascal, Delphi, and Java yes.. But what language is it written in? It's definitely NOT Pascal or Delphi. It isn't Java. It's C.
There's ONE reason for that: SPEED. There IS a slowdown in other languages (even Delphi and Pascal) which is what you're not understanding.
The simple indirect access to a C API isn't optimised out. When you load these API's in other languages, a whole new layer is added on top of it. JNI is the perfect example and there's NO WAY to get rid of it. Delphi is managed.
2015-02-22 15:23:05
From: slacky
Didn't mean to come of as stubborn. I pointed out 1 thing, and asked a question (badly formulated), where I asked why OpenGL would be better from C ("You also mention OpenGL, I am not sure why") which you answered (in a somewhat spiteful manner I must add).
And yes, I do know why he passed an allocator to the plugin… Meh. So harsh for just because I asked a small simple question.
- I think i'm done here.
2015-02-22 15:27:59
From: slacky
Didn't mean to come of as stubborn. I pointed out 1 thing, and asked a question (badly formulated), where I asked why OpenGL would be better from C ("You also mention OpenGL, I am not sure why") which you answered (in a somewhat spiteful manner I must add).
And yes, I do know why he passed an allocator to the plugin… Meh. So harsh for just because I asked a small simple question.
- I think i'm done here.
2015-02-22 17:32:16
2015-02-22 17:50:45
2015-02-23 15:05:10
From: SirPrize
I have been just looking around and reading your posts @Brandon trying to learn something although a lot of it is a bit over my head :D You seem like you reeeeally know the technical side of just about everything.
2015-02-23 15:30:24
2015-02-23 21:06:14
2015-02-23 21:45:42
From: Brandon
I would vote PYTHON as the main language for Simba.
2015-02-23 22:15:14
2015-02-23 23:16:09
From: Olly
Lol, It won't happen even if it did 90% of people would still use pascal.
If you want a python simba like this bug @slacky to make a newer release of rafiki.
2015-02-24 16:35:14
From: the bank
SCAR was never meant to be anything serious, it was originally just a temporary replacement/side project of AutoRune.
Fact is, I don't care what anyone says, Java, C++, .NET languages…just about anything is considerably faster, more powerful, and prettier on the eyes than pascal/delphi.
2015-02-24 16:36:42
From: grats
How hard would it be to put a python interpreter inside of simba
that's the "easy part" or am I wrong?
2015-02-24 18:09:29
From: Wizzup?
Java and C# are not prettier on the eyes than (modern) Free Pascal.
2015-02-25 08:15:33
From: Wizzup?
Yes, that is the easy part. The hard part is integrating everything well. I put some effort into libmml/pymml, and Ian has recently picked that up quite a bit. So in theory with a bit more work you can do quite some basic and advanced stuff from python using Simba's library. But not the GUI parts.