3 plus ones
Shared publicly•View activity
View 4 previous comments
- Ok. Thanks for clarification. Lets hope for a little more syntax sugar (the array syntax in the last release is some IMO) in future releases.Sep 12, 2014
- Almost all those features were already available in DWS and SmartPascal! :-) http://en.m.wikipedia.org/wiki/The_Smart_Pascal_programming_languageSep 12, 2014
- I am so glad that I can write windows applications with Smart Pascal... oh wait, I can't.
"Smart Pascal does not support generics."
Oh, thanks, move on. :)
Don't get me wrong, some syntax in SP is nice but that does help me as a Delphi developer as much as it helps me when C# gets new things. As long as the majority of Delphi developers still does not want to use new language features because they are slow, verbose, cryptic, too c-ish or any other flimsy excuse EMBT does not waste their resources for the 5% (*) devs actually enjoying these.
* some randomly picked small numberSep 12, 2014
- Lars FosdalOwner+4Once you go Generics, there is no way back.Sep 12, 2014
Come on... Smart Pascal can write Windows applications, in several ways, and some much better integrated than Delphi with the "native" platform!
1. As a regular AJAX/HTML5 stand-alone app (plain index.html without server) running in any modern Browser.
2. Thanks to node-webkit http://www.delphitools.info/2012/12/13/desktop-html5-apps-game-changer-node-webkit
3. Via the upcoming Jon's project http://jonlennartaasenden.wordpress.com/2014/09/02/smart-mobile-studio-goes-native which targets also Windows 8 new UI, on any kind of processor
4. Via DelphiWebScript (which is the core compiler of Smart, and has a JIT which is faster than Delphi compiler for some - specific - floating point task) http://www.delphitools.info/dwscript and here you can use regular Delphi code for full access to the Win32/Win64 API
Note that 3+4 gives full access to the Win32/Win64 API, whereas 3+5 gives access to the new WinRT API, whereas Delphi does not (and is not planned to do, AFAIK).
Yes, SmartPascal does not support generics yet.
But it is tempered by the fact that it has an awesome array support, and you have the classic object pascal factory pattern of "type of class" and virtual constructors.
But I'm quite confident Eric would be able to add generics to DWS/SMS, when he would like to, and have time to refactor the compiler AST somewhat deeper. Do you remember your own discussions on http://www.delphitools.info/2012/11/21/pascalish-looking-generics-poll ? :)
BTW, are all Delphi compiler restrictions about generics (unexpected internal errors, huge exe size, slowness...) fixed with XE7?
IMHO generics are not mandatory.
I understand when he wrote that "Once you go Generics, there is no way back".
But I used to spend a lot of time in C# generics and several awesome C# libraries (pretty close to your great library, Stephan), (ab)used (of) LINQ queries, fight against WCF, RhinoMock, and Unity XML configuration files, and I still prefer "classic" object pascal code, without generics.
Today, if I need something like a template system, I use Mustache, and generates code. If I need a factory lazy pattern for classes, I use virtual constructors. If I need stubs/mocks or factories for interfaces, a TypeInfo(IAnyInterface) does the job, without the generics overhead.
I can see almost nothing I could do with Generics, which I could not do with regular code. Yes, I agree I can't make my code looks like C#, but I can still follow SOLID principles, without being lost in some language-level "design patterns", which sounds more like Lego bricks than true computer science.
IMHO as programmers, we should +focus on data structures, not on code+. I'm sure you know the Linus' quote, and is what I learnt by reading Knuth and others.
Of course, this is a matter of taste.
- I am not saying that you cannot do quite some nice things with SMS but the point is that I am developing native windows applications (i.e. some exe with dlls that run on a windows machine) And afaik that cannot be done with SMS. And even if I can compile some application to some exe can I use DevExpress and all the other 3rd party libraries we are using for our application (several million lines of code) in it? Afaik the answer is no. So even if SMS offered the most awesome pascal syntax ever and the most advanced IDE out there it would be of no benefit to me.Sep 13, 2014
Add a comment...