Jump to content

Edwin Yip

Members
  • Content Count

    435
  • Joined

  • Last visited

  • Days Won

    3

Posts posted by Edwin Yip


  1. 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!

    • Like 1

  2. On 6/23/2021 at 6:07 AM, Arnaud Bouchez said:

    @Stefan Glienke

    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.pas

     

    In 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 ;)


  3. 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??? ...


  4. 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 ;)

     


  5. 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...

    • Like 1

  6. 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.

    • Like 1

  7. 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) ;)


  8. On 3/7/2021 at 7:35 AM, Mike Torrettinni said:

    I re-ran with TSynDictionary to verify again, and it's much faster versus TDictionary for string searches, not so much for integers. But seems to be pretty much same performance in 32bit and 64 bit!

     

    32bit:

    image.png.11bea3f77812e857bca91205773f7004.png

     

    64bit:

    image.png.f14d4425bbdf15f394d8a45cca9ea095.png

    mORMot never ceases to surprise me ;) Mike, can you share your benchmarking code on github?


  9. 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.

    • Like 1

  10. @Dalija Prasnikar,

    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...


  11. 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.

    • Like 1
×