Possible future competition for Delphi and FPC? lazarus / 64-FPC development ---------------------------------------------------------------------- SlightlyOutOfPhase · 2018-12-14 03:27 . ---------------------------------------------------------------------- CCRDude · 2018-12-14 08:48 From something called "professionally written", I would expect file headers. Would make it much easier for the reader to understand the basic structure of the repo. I would also expect some kind of documentation, "docs/" is just external information used, and "features.txt" is in cyrillic letters, and Google Translate only reveals attributes as something worth noting. I see in your post history that you're unhappy about FPC not supporting attributes, but I mostly see many features that are not listed in the translation. I see references to JS, LLVM and execution VMs, but all this seems to be external. And I see that it seems to use CodeTyphon for testing, instead of pure Lazarus. Since CT is based on Lazarus, it would make much more sense to test it with Lazarus first. Finally, keep in mind that any advanced IT student can write a simple compiler, but Delphi and FPC are much more than that (take a look at their rich RTLs). I could try to see it from a different perspective, but if you raise the bar that high, disappointment is a logical first reaction ---------------------------------------------------------------------- marcov · 2018-12-14 09:23 Instead of posting here some empty message, why don't you post your testing results with e.g. Delphi or FPC sources? From what I can see it is a parser more than a compiler with an incomplete virtual machine. ---------------------------------------------------------------------- Thaddy · 2018-12-14 10:24 Rather nice, but not very good code: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i function Sign(I: Integer): Integer; inline; // faster then Math.Sign.begin  if I < 0 then    Sign := -1  else if I > 0 then    Sign := +1  else    Sign := 0;end; That does not look too good when a proper student would probably write something like this: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i function sign(const i:integer):integer;begin Result := integer(i > 0) - integer(i < 0); // casts are cheap..end;Which is branchless.... There are more first look issues... ---------------------------------------------------------------------- wp · 2018-12-14 10:42 Quote from: Thaddy on December 14, 2018, 11:24:30 amCode: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i function Sign(I: Integer): Integer; inline; // faster then Math.Sign.begin  if I < 0 then    Sign := -1  else if I > 0 then    Sign := +1  else    Sign := 0;end;A question regarding the comment "faster than Math.Sign": Why is this code supposed to be faster than the one which I just copied out of Math.pas? Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i Type  TValueSign = -1..1; const  NegativeValue = Low(TValueSign);  ZeroValue = 0;  PositiveValue = High(TValueSign); function Sign(const AValue: Integer): TValueSign;inline;begin  If Avalue<0 then    Result:=NegativeValue  else If Avalue>0 then    Result:=PositiveValue  else    Result:=ZeroValue;end; ---------------------------------------------------------------------- 440bx · 2018-12-14 15:11 Quote from: Thaddy on December 14, 2018, 11:24:30 amRather nice, but not very good code: That does not look too good when a proper student would probably write something like this: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i function sign(const i:integer):integer;begin Result := integer(i > 0) - integer(i < 0); // casts are cheap..end;Which is branchless.... Yes, it is branchless but...  as written above the function's result is undefined when the parameter passed to it is zero. Should that be documented as a "limitation" ?  I guess a "proper student" would properly initialize the return value upon function entry.  In programming, propriety is even better than property. ---------------------------------------------------------------------- Remy Lebeau · 2018-12-15 00:26 Quote from: 440bx on December 14, 2018, 04:11:23 pmYes, it is branchless but...  as written above the function's result is undefined when the parameter passed to it is zero. How do you figure that?  I see it as being defined as 0: integer(i > 0) = integer(0 > 0) = integer(false) = 0 integer(i < 0) = integer(0 < 0) = integer(false) = 0 So: Result = integer(i > 0) - integer(i < 0) = 0 - 0 = 0 Quote from: SlightlyOutOfPhase on December 14, 2018, 04:28:32 pmYours is from the FPC version I think? It seems likely they're referring to Delphi. I can't remember what that implementation looks like. Like this: Code: [Select]type   TValueSign = -1..1; const   NegativeValue = Low(TValueSign);   ZeroValue = 0;   PositiveValue = High(TValueSign); function Sign(const AValue: Integer): TValueSign; begin   Result := ZeroValue;   if AValue < 0 then     Result := NegativeValue   else if AValue > 0 then     Result := PositiveValue; end; function Sign(const AValue: Int64): TValueSign; begin   Result := ZeroValue;   if AValue < 0 then     Result := NegativeValue   else if AValue > 0 then     Result := PositiveValue; end; function Sign(const AValue: Single): TValueSign; begin   if (PInteger(@AValue)^ and $7FFFFFFF) = $00000000 then     Result := ZeroValue   else     if (PInteger(@AValue)^ and $80000000) = $80000000 then       Result := NegativeValue     else       Result := PositiveValue; end; function Sign(const AValue: Double): TValueSign; begin   if ((PInt64(@AValue)^ and $7FFFFFFFFFFFFFFF) = $0000000000000000) then     Result := ZeroValue   else if ((PInt64(@AValue)^ and $8000000000000000) = $8000000000000000) then     Result := NegativeValue   else     Result := PositiveValue; end; function Sign(const AValue: Extended): TValueSign; begin {$IFDEF CPUX64}   if ((PInt64(@AValue)^ and $7FFFFFFFFFFFFFFF) = $0000000000000000) then     Result := ZeroValue   else if ((PInt64(@AValue)^ and $8000000000000000) = $8000000000000000) then     Result := NegativeValue   else     Result := PositiveValue; {$ELSE !CPUX64}   if (PExtendedRec(@AValue)^.Frac and $FFFFFFFFFFFFFFFF) = $0000000000000000 then     Result := ZeroValue   else     if PExtendedRec(@AValue)^.sign then       Result := NegativeValue     else       Result := PositiveValue; {$ENDIF} end; ---------------------------------------------------------------------- VTwin · 2018-12-15 00:44 I'd encourage assisting with FPC rather than competing. Hard to see how they could jump ahead. That's a huge bar. What is the goal? ---------------------------------------------------------------------- 440bx · 2018-12-15 01:04 Quote from: Remy Lebeau on December 15, 2018, 01:26:21 amQuote from: 440bx on December 14, 2018, 04:11:23 pmYes, it is branchless but...  as written above the function's result is undefined when the parameter passed to it is zero. How do you figure that?  I see it as being defined as 0: Remy, you are absolutely correct. It gets assigned false - false which is false.  I owe Taddy an apology. Thank you for pointing out that mistake. ---------------------------------------------------------------------- marcov · 2018-12-15 12:30 Quote from: SlightlyOutOfPhase on December 14, 2018, 04:28:32 pmQuote from: marcov on December 14, 2018, 10:23:13 amFrom what I can see it is a parser more than a compiler with an incomplete virtual machine. I'm not so sure about that. It seems to implement the full infrastructure of a compiler, e.g. type-checker/e.t.c and even a package system. It also has a variety of in-progress codegen backends, not just a VM implementation: Well, we see. The point remains, what does it do?  Can it compile code? Can it produce working exes for major OSes ? How do they perform, what dialect does it support? Does it require modification of existing delphi sourcode, and if it does, how much? (always a problem with compilers with IL backends) Does it have a massive own libraries (fileformats, networking, even simple date calculations), or can it compile borrow them from some major compiler? I think the whole competition angle is dragged in by the hairs. All I see is one of the many pascal->IL attempts(*), nothing close to a production product like Delphi or FPC. That Il2LLVM generator has barely 100 uncommented lines. Worse, I don't see any evidence of what works, just the codedump. Talk of competition is very, very, very premature. Initial compilers can be made by a focussed person or a team (e.g. as part of a student project) in a few months, specially if you borrow code and avoid the hard parts like own codegenerators. But then every step you take widens the project, and it slows down, usually beyond the abilities of a single person who can only afford fulltime work on it for so long. Making them production ready, dialect, codegeneration quality and libraries beyond the bare minimum and supporting them for a period of time, that is where the work goes.  Initial means nothing there are so many small compilers (*) the last similar message is not even that long ago: http://forum.lazarus-ide.org/index.php/topic,43007.0.html ---------------------------------------------------------------------- Laksen · 2018-12-15 20:48 Diversity in a software ecosystem is great. Good luck to those people