Re: [fpc-pascal] Pointer hashing

2017-01-31 Thread Ryan Joseph
shing a pointer does not meet none of this goals as it is > process wide unique (no collisions) and its size is the fastest compare > operation (most architectures). Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pa

[fpc-pascal] Parameterless constructors are not allowed in records or record/type helpers

2017-02-05 Thread Ryan Joseph
Why is this restriction in place and what are the alternatives if any? Some times I want to just provide a method that sets default values for a record without any parameters but FPC doesn’t let me for some reason. Regards, Ryan Joseph

Re: [fpc-pascal] Parameterless constructors are not allowed in records or record/type helpers

2017-02-05 Thread Ryan Joseph
> On Feb 5, 2017, at 3:27 PM, Sven Barth wrote: > > constructor with a default parameter. How? never heard of this. Thanks. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.or

Re: [fpc-pascal] Parameterless constructors are not allowed in records or record/type helpers

2017-02-05 Thread Ryan Joseph
same for any kind of routine: function, procedure, method, > constructor...) Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Parameterless constructors are not allowed in records or record/type helpers

2017-02-05 Thread Ryan Joseph
s worth a shot... Alternatively you could declare a class > function named Create that returns an instance of the record. Even Delphi is > using that for Rtti.TRttiContext. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists

Re: [fpc-pascal] Parameterless constructors are not allowed in records or record/type helpers

2017-02-07 Thread Ryan Joseph
ic" disables that. That's > why. > > Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] Overriding generic methods

2017-02-09 Thread Ryan Joseph
TList; TObjectList = class (TObjectListAbstract) procedure Add (value: T); override; end; Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman

Re: [fpc-pascal] Overriding generic methods

2017-02-10 Thread Ryan Joseph
Of course, I should have known. I’m just recently getting started on generics and finding some uses for them. Thanks. > On Feb 10, 2017, at 3:22 PM, Marco van de Voort wrote: > > After specialization, the method signature now substitutes tobject for T, so > try Regards,

[fpc-pascal] Writeln in threads

2017-02-17 Thread Ryan Joseph
Is writeln thread safe? I’m getting some strange crashes and I’m curious if they’re related to calling writeln on multiple threads. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org

[fpc-pascal] Array of const and generics

2017-03-02 Thread Ryan Joseph
TCollection; constructor TCollection.Create (args: array of const); begin // ERROR: args[0] is not the type we specialized for. can’t typecast either. if args[0].vtype = vtinteger then Add(T(args[0].vinteger)); end; procedure TCollection.Add (a: T); begin end; Regards, Ryan

Re: [fpc-pascal] Array of const and generics

2017-03-02 Thread Ryan Joseph
o I was always using array of const. Thanks, learning more new things again! Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] TypeInfo question

2017-03-23 Thread Ryan Joseph
string comparing, allocating memory etc... that would adversely affect performance since these classes need to perform fast data lookups/insertions. Thanks. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http

Re: [fpc-pascal] TypeInfo question

2017-03-23 Thread Ryan Joseph
> On Mar 23, 2017, at 11:16 PM, Sven Barth via fpc-pascal > wrote: > > TypeInfo() simply inserts the load of a pointer value, so there's not even a > call. > > Great, that’s what I was hoping. Thanks. Regards, Ryan Joseph

Re: [fpc-pascal] TypeInfo question

2017-03-23 Thread Ryan Joseph
n option. type TLongIntMatrix = specialize TMatrix; TObjectMatrix = specialize TMatrix; function TMatrix.RetainValue (value: T): T; begin if typeKind = tkClass then TObject(value).Retain; result := value; end; Regards,

Re: [fpc-pascal] Threading vs Parallelism ?

2017-03-29 Thread Ryan Joseph
your problem is designed like this then you can offload the processing to the GPU and get some serious performance benefits. The catch is that reading/writing memory to the GPU is slow so unless you’re processing on large batches of data you’ll spend more time accessing memory than proce

Re: [fpc-pascal] Threading vs Parallelism ?

2017-03-31 Thread Ryan Joseph
performance increases unless you designed your program to scale for parallelism. Running 250 threads on a single core isn’t going to be 250x faster but running 250 threads on 250 cores may be. Regards, Ryan Joseph ___ fpc-pascal maillis

Re: [fpc-pascal] Threading vs Parallelism ?

2017-03-31 Thread Ryan Joseph
y don’t want to (or shouldn’t) be intentionally designing your programs like this unless you have a real need for “true” parallelism with multiple compute units. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lis

Re: [fpc-pascal] Threading vs Parallelism ?

2017-03-31 Thread Ryan Joseph
ultiple cores, parallelism probably means using the GPU via an API like OpenCL, which is far cry from threading some tasks to run async. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cg

[fpc-pascal] Array clearing

2017-03-31 Thread Ryan Joseph
SetLength right?) remains in the same location. var list: array of integer; SetLength(list, 10); for i := 0 to high(list) do list[i] := 0; FillChar(list[0], Length(list) * sizeof(integer), 0); Regards, Ryan Joseph ___ fpc-pascal maillist

[fpc-pascal] Setting record values

2017-03-31 Thread Ryan Joseph
TPoint.SetPoint (_x, _y: integer); begin x := _x; y := _y; end; same outcome but which is more efficient? 1) point.SetPoint(x, y); 2) point := PointMake(x, y); Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] Setting record values

2017-04-01 Thread Ryan Joseph
signing a value directly. Maybe it’s totally trivial but if it is it’s something I should cut out of my design going forward. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Array clearing

2017-04-01 Thread Ryan Joseph
the reference. Thanks. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Array clearing

2017-04-01 Thread Ryan Joseph
> On Apr 1, 2017, at 2:50 PM, Ryan Joseph wrote: > > Yeah, I was concerned with just compiler types or weakly retained classes > where I’m just keeping the reference. Another question. Is it more efficient/faster to reallocate a new array of the same size or call FillChar on

Re: [fpc-pascal] Threading vs Parallelism ?

2017-04-01 Thread Ryan Joseph
eads when you could just run it one thread? Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Array clearing

2017-04-01 Thread Ryan Joseph
ay is being iterated and I need to know which values are set. Basically I have a dynamic array I grow to a certain size and this process happens in a loop. The options are to allocate/free the array every cycle or clear memory and allocate the array once. Re

Re: [fpc-pascal] Array clearing

2017-04-02 Thread Ryan Joseph
implementation of FillChar exactly? For all I know it has to iterate over a range of bytes and this could be slower than allocation of memory. Maybe some of the compiler people know these details. Regards, Ryan Joseph ___ fpc-pascal maill

Re: [fpc-pascal] Setting record values

2017-04-03 Thread Ryan Joseph
uot;&Set" is essentially your "SetPoint" method. "Make" is a constructor. > "Make2" is a static class function with "inline". "MakePoint" is your > creation function and "MakePoint2" is the same with an inline modifier. >

Re: [fpc-pascal] Array clearing

2017-04-03 Thread Ryan Joseph
I’m just getting crashes. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Array clearing

2017-04-04 Thread Ryan Joseph
; > end; Doesn’t iterating the array default the purpose of FillChar? The goal was the most efficient way clear the array with zero’s. Even if the array if nested 3 levels deep (anArray[x][y][z]) it should (I hope) be a contiguous block of memory that was allocate

Re: [fpc-pascal] Array clearing

2017-04-04 Thread Ryan Joseph
news for performance. Does SetLength on a single level dynamic array not even allocate a continuous block of memory? I could use GetMem and array[0..0] but it seems like dynamic arrays should do basically that anyways if they’re not nested. Regards

Re: [fpc-pascal] Array clearing

2017-04-04 Thread Ryan Joseph
this exactly like it’s represented in memory. There’s only one “sub array” in this 2x2 array so how does that look in memory? Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Array clearing

2017-04-04 Thread Ryan Joseph
> On Apr 4, 2017, at 10:07 PM, Jürgen Hestermann > wrote: > > Am 2017-04-04 um 15:40 schrieb Ryan Joseph: > > I’m glad I asked because of arrays of pointers is bad news for performance. > > I don't think that you will notice a performance issue with dynamic arrays

Re: [fpc-pascal] Array clearing

2017-04-04 Thread Ryan Joseph
nts. Yeah after all this talk, I’m going to use array[0..0, 0..0, 0..0] and allocate the memory myself to avoid overhead and confusion. Thanks for explaining everything to me but this time going low level makes the most sense. Regards, Ryan Joseph

Re: [fpc-pascal] Array clearing

2017-04-04 Thread Ryan Joseph
to arr[2,9], > arr[3,0] to arr[3,9], and so on. Thanks that helps. Indeed this is not what I need and I’m not even taking advantage of the resizable elements so I better not use dynamic arrays for my matrix. Regards, Ryan Joseph ___ fp

[fpc-pascal] Out of scope method?

2017-04-06 Thread Ryan Joseph
feature but I never heard of it in Pascal. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Out of scope method?

2017-04-06 Thread Ryan Joseph
> On Apr 6, 2017, at 3:45 PM, Tony Whyman > wrote: > > Isn't this what a COM Interface does - or at least a descendent of > TInterfacedObject? > > Tony Whyman No idea. Examples? Regards, Ryan Joseph ___ fpc-pasc

Re: [fpc-pascal] Out of scope method?

2017-04-06 Thread Ryan Joseph
ocedure TestScope; var scope: TScopeObject; begin scope := TScopeObject.Create; end; Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Out of scope method?

2017-04-06 Thread Ryan Joseph
er to invoke a method on TObject descendants when they go out of scope? If it does it for compiler types like dynamic arrays I imagine it could do the same for classes. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal

Re: [fpc-pascal] Out of scope method?

2017-04-06 Thread Ryan Joseph
ng as garbage collection method has been discussed to > dead on various maillists and forums. Both Delphi and Lazarus/FPC. Hmm, that sounds like a hack. Is the verdict this is generally a bad idea? I was just curious about it and it seems like a reasonable feature a language ma

Re: [fpc-pascal] Out of scope method?

2017-04-06 Thread Ryan Joseph
pe and that would be a handy way to manage this. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Out of scope method?

2017-04-06 Thread Ryan Joseph
ad if the compiler told me when an instance left scope. Specially in a few cases you could load up the pool too large and cause performance problems so I need to be careful of that. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@l

Re: [fpc-pascal] Out of scope method?

2017-04-06 Thread Ryan Joseph
Portuguese) > http://objectpascalprogramming.com/posts/interfaces-e-o-metodo-estatico-new/ This sounds highly prone to errors to be honest. Don’t you lose all type checking also? That would have to be deal breaking I would think. Regards, Ryan Joseph _

Re: [fpc-pascal] Out of scope method?

2017-04-06 Thread Ryan Joseph
u need to have a matching interface for all your classes, and if not then you’ll lose type checking. IAction needs to have all the methods in TAction for type checking to work right? Regards, Ryan Joseph ___ fpc-pascal mailli

Re: [fpc-pascal] Out of scope method?

2017-04-06 Thread Ryan Joseph
one class. > So, it is simple implement all methods of an interface. Ouch, that’s far from a good solution then imo and the auto release pool concept from Cocoa is less work to implement and safer even. A direct compiler notification would be best thoug

[fpc-pascal] Constants in generics

2017-04-08 Thread Ryan Joseph
FData = array[0..L] of T; end; var flist: specialize TFixedList; Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Constants in generics

2017-04-09 Thread Ryan Joseph
list for the compiler team? There’s no way to extend the functionality of static arrays in Pascal and this would accomplish that well. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.or

Re: [fpc-pascal] Array clearing

2017-04-12 Thread Ryan Joseph
in memory and “clear” means setting all values to default() for that type. Not a difficult distinction to remember imo. The whole API is incomplete though so it doesn’t even make sense to add this unless your going to overhaul everything and make a complete list of operati

Re: [fpc-pascal] Array clearing

2017-04-12 Thread Ryan Joseph
he end never added? That’s one the most basic operations for arrays. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Array clearing

2017-04-12 Thread Ryan Joseph
ue for > > ArrayB.Fill(DefaultValue); That’s one of the reasons we won’t be seeing this function any time soon. ;) Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Array clearing

2017-04-12 Thread Ryan Joseph
c arrays directly because they’re too bare bones so adding them at all wasn’t worth it for me. However, if the API was more robust I would start using them instead of my own class/record wrappers. Regards, Ryan Joseph ___ fpc-pascal maill

Re: [fpc-pascal] Constants in generics

2017-04-12 Thread Ryan Joseph
list: array[0..L-1]; procedure Add (elem: T); end; Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Array clearing

2017-04-12 Thread Ryan Joseph
> On Apr 12, 2017, at 9:24 PM, Jürgen Hestermann > wrote: > > SetLength(Array,Length(Array)+1); > > You will get an additional element (filled with zeros). > Then you can set > > Array[High(Array)] := whateveryouwant; Well sure, but this kind of code is exactly what programmers abstract and

Re: [fpc-pascal] Array clearing

2017-04-13 Thread Ryan Joseph
er array. In this case, a lot of memory operations and copy operations >> are performed thus degrading the performances of the code. > > Correct. Why is it copying the array and freeing instead of resizing the existing block (realloc)? That sounds crazy but I don’t know how

Re: [fpc-pascal] Array clearing

2017-04-13 Thread Ryan Joseph
t the array is indeed copied. > So the real point here is that ReAllocMem will copy and allocate a new block if the old one can’t be resized, therefore this really isn’t about SetLength as much as the memory manager itself. Regards, Ryan Joseph

Re: [fpc-pascal] *** GMX Spamverdacht *** Re: *** GMX Spamverdacht *** Re: WebAssembly Target

2017-04-14 Thread Ryan Joseph
allow execution of arbitrary code and as far as I know it’s still the only language that can manipulate the DOM on the browser to perform actions on the client side like changing the properties of HTML elements. Regards, Ryan Joseph ___

[fpc-pascal] Coroutines and VirtualAlloc

2017-04-15 Thread Ryan Joseph
function? I’d like to test the code but I have no idea what that function does or how to replace it. http://www.festra.com/wwwboard/messages/12899.html Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http

Re: [fpc-pascal] Coroutines and VirtualAlloc

2017-04-18 Thread Ryan Joseph
me; writeln('finished'); end; start loop 0 yield stepped out resume loop 1 yield resume loop 1 yield resume loop 1 yield resume loop 1 yield resume loop 1 yield finished Regards, Ryan Joseph ___ fpc-pascal maillis

Re: [fpc-pascal] Coroutines and VirtualAlloc

2017-04-19 Thread Ryan Joseph
ut using threading. From the descriptions it sounds like longjmp moves the current point of execution of the program (if that concept exists like I imagine it does) so you could step in and out of loops or functions. If not that then what do those functions actually do?

Re: [fpc-pascal] Coroutines and VirtualAlloc

2017-04-19 Thread Ryan Joseph
nd how assembly works but I thought it would just start over and the state of the stack in that function would still be the same as before so I could keep adding 1 every pass. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@list

Re: [fpc-pascal] Coroutines and VirtualAlloc

2017-04-19 Thread Ryan Joseph
t there’s something I’m missing obviously. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Coroutines and VirtualAlloc

2017-04-19 Thread Ryan Joseph
nteger = 0; begin end; Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Coroutines and VirtualAlloc

2017-04-19 Thread Ryan Joseph
what the code in the original link did? I was going to try it but I never figured out how to replace VirtualAlloc without Windows (I’m on a Mac). Thanks. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://

Re: [fpc-pascal] Coroutines and VirtualAlloc

2017-04-19 Thread Ryan Joseph
low tries to manage the stack frames and restore them but it requires Windows for the VirtualAlloc function and I’m on a Mac. No idea if that code works or not and it looks kind of risky honestly. http://www.festra.com/wwwboard/messages/12899.html Regards,

Re: [fpc-pascal] Coroutines and VirtualAlloc

2017-04-20 Thread Ryan Joseph
t need to be synched with a main loop and can’t block. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Coroutines and VirtualAlloc

2017-04-20 Thread Ryan Joseph
encapsulated in that statement. I’m building these big ugly state machines inside my classes and polluting the instance variables with muck. Coroutines would greatly clean this up and with only minimal overhead. Regards, Ryan Joseph ___ fpc-

[fpc-pascal] Record operator for assignment

2017-04-27 Thread Ryan Joseph
rec: TMyRec; rec := TMyRec([1, 2, 3]); // Illegal type conversion: "Set Of Byte" to "TMyRec" Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Record operator for assignment

2017-04-27 Thread Ryan Joseph
e. The syntax for a default constructor already exists in the language but it’s not implemented outside of type declarations for some reason. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.free

Re: [fpc-pascal] Record operator for assignment

2017-04-27 Thread Ryan Joseph
gt; change once proper support for array constructors is added. Though I don't > know whether this would work then ;) Huh, that syntax works in constructors, just not in the operator overloading. Anyways I guess I’ll just assume that’s not implemented behavior. Thanks. Regards, Ry

Re: [fpc-pascal] Record operator for assignment

2017-04-28 Thread Ryan Joseph
1; y: 2; z: 1} or some magic function like writeln: rec := TMyRec(x: 1; y: 2; z: 1) rec := @(x: 1; y: 2; z: 1) etc… Anyway it could be achieved that would be nice to have a built in constructor for records on the language level. Regards, Ryan Joseph __

Re: [fpc-pascal] Record operator for assignment

2017-05-04 Thread Ryan Joseph
> On Apr 28, 2017, at 3:51 PM, Ryan Joseph wrote: > > I almost struck out there. ;) There’s at least a possibility for anyone > interested. A few years ago I looked at the compiler source and decided it > was beyond me to even understand the code base well enough to do anyt

Re: [fpc-pascal] Record operator for assignment

2017-05-04 Thread Ryan Joseph
l to do and does behave like a scripting language in many ways (inferred types for example). That being said Pascal records should still have a default constructor since this is a pattern repeated extremely frequently. Regards, Ryan Joseph __

Re: [fpc-pascal] Record operator for assignment

2017-05-07 Thread Ryan Joseph
solution. Yeah Golang has the same thing: c := Circle{x: 0, y: 0, r: 5} and basically the same syntax as Pascal or Swift. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] FPC Graphics options?

2017-05-18 Thread Ryan Joseph
n by the compiler team as to why that code performed so terribly? I saw there were many optimizations that could be made (Floor() is stupid slow for some reason in FPC) but still that’s no excuse. The compiler must be doing something really stupid for it mess up like that but how

Re: [fpc-pascal] FPC Graphics options?

2017-05-18 Thread Ryan Joseph
re signification calculations. In my isometric engine the sorting process got terribly complicated and CPU intensive, so much so in fact it won’t be able to run on mobile like I planned. Regards, Ryan Joseph ___ fpc-pascal maillist -

Re: [fpc-pascal] FPC Graphics options?

2017-05-18 Thread Ryan Joseph
at the hell FPC is doing to make it so slow (besides the call to Floor()). The compiler team should be worried about this also I would think. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.free

Re: [fpc-pascal] FPC Graphics options?

2017-05-18 Thread Ryan Joseph
a staggering difference in performance and I was extremely curious to see if those calls to Floor() were causing it. Hopefully this was a red herring and FPC isn’t as bad as the test suggests. Regards, Ryan Joseph ___ fpc-pascal maillist -

Re: [fpc-pascal] FPC Graphics options?

2017-05-18 Thread Ryan Joseph
vs 40 fps from the same code? After I looked at the code I didn't see anything strange about it so it just got me thinking, if that code can be that slow how slow is all the stuff I’m writing on a daily basis? It’s just worrying that’s all. Reg

Re: [fpc-pascal] FPC Graphics options?

2017-05-18 Thread Ryan Joseph
pcx64 the program crashed on the line: plot( x, y, rgbmul( col, fxmul( br, round(ddist) ) ) ); or I would have done this myself this morning. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.o

Re: [fpc-pascal] FPC Graphics options?

2017-05-18 Thread Ryan Joseph
s. Floor is there as I expected and 26% is pretty extreme but the others are floating point division? How does Java handle this so much better than FPC and what are the work arounds? Just curious. As it stands I can only reason that I need to avoid dividing floats in FPC like the plague. Reg

Re: [fpc-pascal] FPC Graphics options?

2017-05-18 Thread Ryan Joseph
mirror, but they are neither finished nor tested. Can you please explain how do calling conventions affect this? I failed to run this at all on my Mac but I’m not sure why and even more confused how this would decimate speeds like this. Regards, Ryan Joseph __

Re: [fpc-pascal] FPC Graphics options?

2017-05-18 Thread Ryan Joseph
fps: 10.7 replacing sin+cos with sincos added 2 fps but that’s not really the issue here. Your profiling says FPC barfed with the math and I’d like to know why. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepas

Re: [fpc-pascal] FPC Graphics options?

2017-05-20 Thread Ryan Joseph
nstant. The "floor" function is a standard C library > function, and hence C compilers know what it does and can evaluate it at > compile time. Therefore, the oy-floor(oy) and oz-floor(oz) expressions are > (equal) constants for C compilers. How are those const

Re: [fpc-pascal] FPC Graphics options?

2017-05-22 Thread Ryan Joseph
ctrl-C ??!?!) here. Thanks for working on this. I updated to the latest trunk version just now and compiling with -O2 -Cfsse3 (the non-SDL version which another user ported) and replacing FLoor() with Trunc() (not sure if that changes the output) I get a 28fps but only 11fps with Floor(). Reg

[fpc-pascal] OpenGL and SDL frustrations

2017-05-23 Thread Ryan Joseph
nableVertexAttribArray(0); glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, sizeof(TVec2), nil); // draw loop glClearColor(0, 0, 0, 1); glClear(GL_COLOR_BUFFER_BIT); glDrawArrays(GL_TRIANGLES, 0, 3); SDL_GL_SwapWindow(window); ... Regards, Ryan Joseph ___

Re: [fpc-pascal] OpenGL and SDL frustrations

2017-05-24 Thread Ryan Joseph
rite shaders if on any given computer I get a different version of GLSL. At least I got it working FINALLY after so much hassle but everything I do could easily break on others computers so... Regards, Ryan Joseph ___ fpc-pascal maill

Re: [fpc-pascal] OpenGL and SDL frustrations

2017-05-25 Thread Ryan Joseph
esn’t matter though and 4.1 will run on older graphics cards? No idea but it’s worrying. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] OpenGL and SDL frustrations

2017-05-25 Thread Ryan Joseph
e’s any performance benefit I can update my code base. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] OpenGL and SDL frustrations

2017-05-25 Thread Ryan Joseph
s only a minor part of the code actually so once you get it down it can be buried and not worried about later. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Why casting interface as Tobject will result in a different reference?

2017-05-26 Thread Ryan Joseph
d to use Supports() to get a reference to the interface from the object. The interface reference can be cached and used later or you need to call Supports every time which does a string compare and is slow. Regards, Ryan Joseph ___ fpc-pasca

[fpc-pascal] GLM library alternative?

2017-05-26 Thread Ryan Joseph
(https://open.gl/transformations). If I knew enough I think I could just build these myself but I’ll likely introduce a bunch of errors at first. Has anyone converted these to Pascal before or having some similar I could look at? Regards, Ryan Joseph

Re: [fpc-pascal] FPC Graphics options?

2017-05-26 Thread Ryan Joseph
blob/master/mselang/benchmark/mctest/mctest_trunc.pas > -O3 -> 8.1 > -O3 -mcpu=corei7 -mattr=+sse3,+ssse3 -> 41.5 FPS Is MSElang another Pascal compiler? I’ve never heard of it. I know LLVM is being used by Apple for Objective-C/Swift (I think) but for Pascal? Regards, Ryan Joseph ___

Re: [fpc-pascal] GLM library alternative?

2017-05-27 Thread Ryan Joseph
it uses similar syntax as the shader language GLSL but you need to know how to construct these yourself otherwise. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] named parameter

2017-05-27 Thread Ryan Joseph
patible. You can add or > change parameters without breaking the method signature. can you show an example of this? Just curious. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cg

Re: [fpc-pascal] named parameter

2017-05-27 Thread Ryan Joseph
“default constructor" as a sorely missing feature in FPC a couple weeks ago. Making redundant constructors for records constantly is pretty silly. If I could figure out the compiler code I would add this myself since it’s probably one of the easier things to implement

Re: [fpc-pascal] GLM library alternative?

2017-05-27 Thread Ryan Joseph
functions in Pascal. Not having glm::perspective or glm::lookAt is enough to really stop you in your tracks and running off to Google for hours. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lis

Re: [fpc-pascal] named parameter

2017-05-27 Thread Ryan Joseph
r he liked my idea to use TPoint(x: 1; y: 2); using the record name as the identifier. I swear I’d add this if I knew how. :) Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/ma

Re: [fpc-pascal] GLM library alternative?

2017-05-27 Thread Ryan Joseph
using 3.x core and the fixed pipeline has been removed which glRotate etc… were part of. I’m using this now but I wanted to learn the “new” stuff some. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists

Re: [fpc-pascal] GLM library alternative?

2017-05-28 Thread Ryan Joseph
rs after I found this out also. Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] GLM library alternative?

2017-05-28 Thread Ryan Joseph
> On May 28, 2017, at 3:22 PM, denisgolovan wrote: > > Looks nice. Thanks for sharing. > How about publishing it on Github with small readme to ease contributions? > There’s some dead 403 links also btw. Regards, Ryan Joseph ___

Re: [fpc-pascal] GLM library alternative?

2017-05-28 Thread Ryan Joseph
> On May 28, 2017, at 10:33 PM, Ryan Joseph wrote: > > projTransform := TMatrix4x4.CreatePerspective(60.0, 500 / 500, 0.1, > 10.0); > modelTransform := TMatrix4x4.CreateTranslation(0, 0, -3.0) * > TMat4.CreateRotateX(54); I found out the problem. I was expecti

<    1   2   3   4   5   6   7   8   9   10   >