

Edwin Yip
-
Content Count
435 -
Joined
-
Last visited
-
Days Won
3
Posts posted by Edwin Yip
-
-
For my new project I need a template engine for generating web pages, while I have concluded which suited my needs the best and I'm quite confident about my conclusion, your opinions and comments might help me to make my final decision.
Since mORMot is my go-to framework for server-side web development, the first candidate to consider is obviously DMustache, which is a fast Delphi/FPC implementation of the popular logic-less Mustache template engine. Actually I've used it in several of my projects and it's great. But sometimes I need more features, but as you know, logic-less means no "if", "while", and so on.
And fortunately I found Sempare Template Engine, which is the only feature-rich template engine for Delphi ( Yes, I meant it, because we all know Delphi was/is mostly focused on GUI development but not web development...)
Pros
===
- Very very feature-rich, "if", "for and while loop", "include", "JSON", "custom methods", and so on. Basically, the feature set it's very close to template engines you can find in web-focused languages such as Java. No other Delphi template engine is even comparable (sorry, I love DMustache, but I also need "if" and "while"...).
- Very well designed! You can tell by just looking at the unit namespaces and the source!
- Documented, and with examples.
- Well-tested (with DUnitX tests)
Cons: While It's also open source, but for commercial uses you need to buy a license key with a very reasonable price.
There are other template engines too, but IMHO, only DMustache and Sempare Template are serious, so I won't list them here...
Your comments are welcomed!
-
1
-
-
Implemented natively in Delphi, as Stephen suggested: https://github.com/ahausladen/JsonDataObjects
Maybe world's fastest: Simdjson, however, there is no complete Delphi wrapper yet, but this one-function only wrapper can get you started quickly if you go this route: https://synopse.info/forum/viewtopic.php?id=5926
-
On 6/23/2021 at 6:07 AM, Arnaud Bouchez said:If you can, please take a look at a new mORMot 2 unit:
https://github.com/synopse/mORMot2/blob/master/src/core/mormot.core.collections.pasIn respect to generics.collections, this unit uses interfaces as variable holders, and leverage them to reduce the generated code as much as possible, as the Spring4D 2.0 framework does, but for both Delphi and FPC.
Most of the unit is in fact embedding some core collection types to mormot.core.collections.dcu to reduce the user units and executable size for Delphi XE7+ and FPC 3.2+.
Thanks a lot for the ideas!It also publishes TDynArray and TSynDictionary high-level features like JSON/binary serialization or thread safety with Generics strong typing.
More TDynArray features (like sorting and search) and also TDynArrayHasher features (an optional hash table included in ISynList<T>) are coming.Wow! So the collections in mORMot2 is/will be even more powerful!
Great to hear that, and as always, we can rely on mORMt/2 ;)
-
12 hours ago, Arnaud Bouchez said:Is it only me or awful and undocumented problems like " F2084 Internal Error: AV004513DE-R00024F47-0 " occur when working on Delphi with generics?
You are not alone! And sadly that's the reason I use as less as generics as possible... sometimes a re-build clears the issue, sometimes I have to re-boot the IDE, it's really unproductive...
And, I thought the bug only exists in my old XE4 compiler, I didn't expect it also lives in the new IDEs... then I wonder, what are the new versions charge for??? ...
-
Great news! It seems that TBCEditor is coming back as open open source again as github.com/TextEditorPro/TTextEditor
But looking at the texteditor.pro site, but quite sure the github repo is by Lasse the same author of the old TBCEditor.
Not sure what improvements has been brought by the new version and but it seems doesn't support CJK characters, pity...
-
3
-
1
-
-
2 hours ago, Anders Melander said:Nice!
Any idea about who the author is?
I know nothing more than his github profile page ;)
-
I guess map2pdb enabled the birth of the following new open source stack tracing library ;)
-
1
-
-
1 hour ago, Der schöne Günther said:That's is what we usually do. Initially, we had the good old JCL. It was the only thing we used it for.
Later, we figured out we don't really need it at all, it was sufficient to hook into a System.ExceptObjProc (and one or two other procedure variables) to point to our own exception handler. There, you can easily acquire the stack trace with with FastMM_Fulldebugmode.dll. It exports three handy methods to acquire the "frame based" and "raw" stack trace and, of course, to just get a string for the textual representation.
Found the detailed steps: https://stackoverflow.com/a/1130506/133516
Edit 1: Would love to see an example of using `System.ExceptObjProc` and the other related procedure variables ;)
-
18 hours ago, Anders Melander said:You probably read it here: https://wiert.me/2017/08/02/delphi-call-stack-from-exception/
You really have a good memory :D
-
6 hours ago, Wagner Landgraf said:Spot on! Thanks for letting me know I'm not completely insane yet. 😅
Well, well, well, I had that misconception too!
While I was puzzled why madshi provides the open source DebugEngine while he already has the madExcept commercial package, but I didn't think too much since Jeroen said so...
Maybe people confused by the name 'Mahdi' with 'madshi' the nickname :)
I shouldn't have that misconception - because IIRC I asked Mahdi Safsafi and he's a doctor from the Middle-east, while IIRC madshi is in Germany...
-
1
-
-
1 hour ago, Fr0sT.Brutal said:VirtualBox is OK for my needs
I was having the same perception for many many years, until my Win 10 Guest became deadly slow on a Win 7 host. Then switched to VMWare and wow, much "snappy" now!
Haven't used Hyper-V though.
-
1
-
-
Amazingly great work, as always!
Do you have a list of 'CSS not supported by HCL'? Thanks!
-
5 hours ago, Renate Schaaf said:Confirmed: Works with uProf now. Great Job.
I get the same info as with VTune: hotspot timings, processor use, stack graph.
Thanks for the info. Just downloaded AMD uProf and the installer supports Windows 7 (but haven't tried it yet) ;)
-
And here is the link of the github project: Wasm by marat1961. @Arnaud Bouchez ;)
Just in case you didn't know, WASM is a subject of JavaScript that's optimized for speed and cross-platform.
-
1
-
-
18 minutes ago, Vincent Parrett said:Use the web installer, you can then choose which parts to install.
Thanks! And realized it needs Win 10 and above ;)
-
Another great job done by @Anders Melander (apart from the drag-and-drop component suite)!
Another has a download link to the standalone VTune Profiler? I want to avoid downloading the 3.3GB oneAPI toolkit....
-
On 4/5/2021 at 5:44 AM, Wagner Landgraf said:Very interesting tool, I believe it opens lots of possibilities. I use AQTime and Sampling Profiler, is anyone able to tell the differences and advantages of VTune compared to those two tools?
Maybe price? ;)
-
Sounds very helpful but I'm out of luck with my old IDE...
-
On 3/7/2021 at 7:35 AM, Mike Torrettinni said:mORMot never ceases to surprise me ;) Mike, can you share your benchmarking code on github?
-
2 hours ago, Dalija Prasnikar said:I am sorry if I misunderstood your point.
You didn't explicitly said why are you suggesting passing TEvent instead of using global access and phrase "Don't forget" can be easily interpreted that if you use global objects directly, code will not work properly. At least that is how I have read it.
No problem. Human's language is sometimes ambiguous, the Pascal language is not, fortunately.
-
1
-
-
I don't follow your reasoning.
As you said, my advise of not accessing a global TEvent variable is to gain flexibility, but not thread-safety - the thread-safety has been provided by TEvent which is a 'sync object'.
So I really don't understand why you said the advise is wrong while you agree on the effects of the advise...
-
7 hours ago, FredS said:I use a global TEvent that is set at shutdown, all my wait functions check that and all threads check it either through wait or in their execute methods.
I think this the standard and easy way. But don't forget to pass the TEvent object to each threads, avoid accessing any global vars in anywhere including inside the a thread.
-
1
-
-
-
The following is a Microsoft article that explains GDI Scaling very well:
The BEST template engine for generating webpages on the server side?
in Tips / Blogs / Tutorials / Videos
Posted
@Fr0sT.Brutal, Thanks for the link!
From the overview webpage the features seems to be quite powerful, but it doesn't seem to be compatible with my XE4 compiler:
[dcc32/dcc64 Error] TemplateEngine.pas(2253): E2030 Duplicate case label
Feature-set aside, it still has less documents and examples than Sempare Template.
But thanks for the link!