You are not logged in.
I've adapted more than 40 examples from the DMVCframework to mORMot2
The intention is:
1. Have more examples for mORMot2
2. Help DMVCframework users transition to mORMot2
I've posted them in my own public GitHub, but I would be very glad if Arnaud is willing to add them to mORMot2 samples
This is a mORMot2 group:
https://t.me/synopse_mormot
And this one is is a Delphi group:
https://t.me/delphidevelopers
Hello,
I'm trying to expand the mORMot2 documentation that was migrated from mORMot1, so it covers all the features exclusive to mORMot2
Here is the projected expasion to mORMot2 documentation (only the expansion):
https://github.com/JavierusTk/mORMot2/t … sad-drafts
If anyone can comment if it's correct or I'm doing it wrongly, I'd be grateful
Those who are interested can continue to improve the SKILL.md file, and then use Claude Code to migrate the remaining Samples files to mORMot 2.
Will you commit the working examples to the official repository?
I would like to add one:
### mormot.app.daemon
Daemon (e.g. Windows Service) Stand-Alone Background Executable Support
- Parent Daemon Settings Class
- Parent Daemon Application Class### mormot.app.agl
Launch, Watch and Kill Services or Executables from a main Service Instance
- `TSynAngelizeService` Sub-Service Settings and Process
- `TSynAngelize` Main Service Launcher and Watcher
The docs/ folder in the latest mORMot2 commit already include those two units:
● Both units are documented in the mORMot2-SAD documentation. Here's the summary:
mormot.app.daemon.pas
Documented in:
- Chapter 03 (line 366): Listed in the unit table as "Daemon/service support"
- Chapter 20 (line 198): Used in code examples for daemon creation
- Chapter 26 (line 150, 548): Mentioned in the architecture overview and deployment section for Windows service deployment
The documentation covers cross-platform daemon/service functionality - the same code can run as a console application, Windows service, or Linux daemon.
mormot.app.agl.pas (Angelize)
Documented in:
- Chapter 03 (line 367): Listed as "Application Graphics Layer" (note: the alignment report questions this description)
- Chapter 20 (section 20.5, starting line 356): Comprehensive documentation of TSynAngelize as mORMot's cross-platform process manager
Chapter 20.5 "Process Manager (Angelize)" provides the most detailed coverage:
- Describes TSynAngelize as similar to NSSM (Windows) or supervisord (Linux)
- JSON-configured and integrated with the daemon framework
- Includes architecture diagrams, code examples, and a feature comparison table with NSSM, supervisord, and systemd
Unfortunately, I don't have FPC installed, and don't have the additional time for it. If you're using it, feel free to contribute
It uses firedac, but I adapted to it just for publishing it: I was using UniDAC
I can expand the documentation to cover this report, and send it for your consideration, if you wish:
Generated: 2025-12-18
Scope: Comprehensive analysis of mORMot 2.0-2.3 features
Method: Comparison of SAD documentation vs 129 source units and 14 internal CLAUDE.md files
Total Features Analyzed: 20
The mORMot2 SAD was adapted from mORMot1 documentation. While existing content is accurate (100% alignment verified), 20 features lack substantive documentation.
Priority Distribution
HIGH (4): IDocList, OpenAPI Generator, ACME, LDAP
MEDIUM (5): Async HTTP, Relay/Tunnel, RSA, PKCS#11, Windows Security
LOW (11): PDF, Reports, Compression, 7-Zip, PE/COFF, etc.
Top 5 Most Important
HIGH - ACME/Let's Encrypt - MENTION_ONLY - Medium effort
HIGH - LDAP Client - MENTION_ONLY - Medium effort
HIGH - OpenAPI Client Generator - MISSING - Medium effort
HIGH - IDocList/IDocDict - MENTION_ONLY - Small effort
MEDIUM - WebSocket Relay/Tunnel - MENTION_ONLY - Medium effort
1. ACME/Let's Encrypt Native Support
Status: MENTION_ONLY
Priority: HIGH
Source: src/net/mormot.net.acme.pas
Internal Docs: src/net/CLAUDE.md
What's in SAD
Chapter 01: Listed as feature ("ACME/Let's Encrypt - Automatic TLS certificate management")
Chapter 03: Listed in units table (mormot.net.acme | ACME/Let's Encrypt)
Chapter 20.6.3: Only documents external certbot, NOT native mORMot support
What's Missing
// Key classes NOT documented:
TAcmeClient // Main ACME v2 client class
TJwsHttpClient // JWS HTTP client for ACME protocol
TAcmeChallenge // HTTP-01 challenge structure
TOnAcmeChallenge // Callback for challenge handling
THttpFullServer // HTTP server with built-in ACME support
// Constants:
ACME_LETSENCRYPT_URL // Production Let's Encrypt
ACME_LETSENCRYPT_DEBUG_URL // Staging/testing
ACME_ZEROSSL_URL // ZeroSSL alternativeImpact: Developers don't know mORMot can automatically obtain TLS certificates without external tools like certbot.
---
2. LDAP Client
Status: MENTION_ONLY
Priority: HIGH
Source: src/net/mormot.net.ldap.pas
Internal Docs: src/net/CLAUDE.md
What's in SAD
Chapter 03: Listed in units table (mormot.net.ldap | LDAP client)
Chapter 21: Fictitious references to GetUserIdFromLDAP() (doesn't exist)
What's Missing
// Key classes NOT documented:
TLdapClient // Main LDAP client class
TLdapCheckMember // Group membership verification
TCldapDomainInfo // Domain info via CLDAP
// Key functions:
CldapGetDomainInfo() // Query domain controller
function LdapAuth() // HTTP BASIC auth via LDAP
// Constants:
LDAP_PORT = '389'
LDAP_TLS_PORT = '636'Impact: Developers can't leverage mORMot's native LDAP client for Active Directory integration.
---
3. OpenAPI Client Generator
Status: MISSING (SAD documents export, not import)
Priority: HIGH
Source: src/net/mormot.net.openapi.pas
Blog Post: Swagger/OpenAPI Client Generator
What's in SAD
Chapter 17.5: Documents generating OpenAPI spec FROM mORMot services (export)
Does NOT document consuming external OpenAPI specs to generate clients (import)
What's Missing
// Key classes NOT documented:
TOpenApiParser // Parse OpenAPI 3.x / Swagger 2 specs
TOpenApiVersion // oav2 (Swagger), oav3 (OpenAPI 3.x)
TOpenApiSchema // Schema definition wrapper
// Usage pattern (NOT documented):
var
Parser: TOpenApiParser;
begin
Parser := TOpenApiParser.Create;
Parser.ParseFile('api-spec.json');
Parser.GeneratePascalUnit('GeneratedClient.pas');
end;Impact: This is a major productivity feature added in v2.3 - developers can consume any REST API with generated type-safe clients.
---
4. IDocList / IDocDict Interfaces
Status: MENTION_ONLY
Priority: HIGH
Source: src/core/mormot.core.variants.pas
Blog Post: Easy JSON with Delphi and FPC
What's in SAD
Chapter 04.5: Extensive TDocVariant/TDocVariantData documentation
Chapter 04 table: Mentions IDocDict, IDocList without explanation
NO examples or usage patterns for the interfaces
What's Missing
// Modern interface-based access (NOT documented):
var
List: IDocList;
Dict: IDocDict;
begin
// Automatic memory management via interfaces
List := DocList('[1, 2, 3, "text"]');
Dict := DocDict('{"name": "John", "age": 30}');
// Safe iteration
for item in List do
WriteLn(item);
// Direct access
WriteLn(Dict['name']); // 'John'
end;Impact: Developers use verbose TDocVariantData patterns when cleaner IDocList/IDocDict is available.
---
5. Async HTTP Server (Direct Usage)
Status: PARTIAL
Priority: MEDIUM
Source: src/net/mormot.net.async.pas
What's Documented
useHttpAsync mode for TRestHttpServer ✓
Server mode comparison table ✓
What's Missing
// Direct HTTP server (NOT via TRestHttpServer):
THttpAsyncServer // Event-driven HTTP server
TPollAsyncSockets // Low-level async socket handling
THttpProxyServer // HTTP proxy with caching
// Architecture details:
// - IOCP on Windows (USE_WINIOCP)
// - epoll on Linux, kqueue on BSD/macOS
// - Thread pool configuration---
6. WebSocket Relay / Tunnel
Status: MENTION_ONLY
Priority: MEDIUM (high enterprise value!)
Source: src/net/mormot.net.relay.pas, src/net/mormot.net.tunnel.pas
What's in SAD
Chapter 03: Listed in table (mormot.net.relay | Firewall traversal)
NO documentation of how to use it
What's Missing (SIGNIFICANT FEATURE!)
RELAY ARCHITECTURE (from source code)
+------------+ PUBLIC RELAY PRIVATE RELAY
| client 1 |---\ +----------------+ +----------------+
+------------+ --->| encapsulation |<-->| decapsulation |
+----------------+ +----------------+
+------------+ --->| | | |---> ORM/SOA Server
| client 2 |---/ +----------------+ +----------------+ (behind firewall)
+------------+
internet simple Linux box corporate LANKey classes:
TPublicRelay - Public server (internet-facing)
TPrivateRelay - Private client (inside firewall)
TTunnelLocal - TCP/UDP port forwarding
Benefits:
Access servers behind firewalls WITHOUT firewall changes
Regular WebSocket connection (works through proxies)
Built-in encryption (SynLZ + optional ECDHE)
---
7. Windows Security (SID/DACL/ACE/SDDL)
Status: NO_DOC
Priority: MEDIUM
Source: src/core/mormot.core.os.security.pas
What's Missing
// Cross-platform Windows security model implementation:
RawSid // Binary SID storage
TSid // SID structure
TSecurityDescriptor // Full SD wrapper
SDDL parsing/generation // Security Descriptor Definition Language
// Key features:
// - Parse/generate SIDs (S-1-5-21-...)
// - DACL/SACL manipulation
// - Conditional ACE expressions
// - Active Directory definitions
// - Kerberos KeyTab support---
8. Native RSA Encryption
Status: MENTION_ONLY
Priority: MEDIUM
Source: src/crypt/mormot.crypt.rsa.pas
What's Missing
// Pure Pascal RSA implementation (no OpenSSL required):
TBigInt // Big integer arithmetic
TRsaContext // RSA computation context
TRsaPrivateKey // Private key handling
TRsaPublicKey // Public key handling
// Features NOT documented:
// - FIPS-level key generation
// - RSASSA-PKCS1-v1.5 signatures
// - RSASSA-PSS signatures
// - Key pair validation
// - Performance notes (slower than OpenSSL, fastest native Pascal)---
9. PKCS#11 / HSM Support
Status: NO_DOC (single table mention)
Priority: MEDIUM
Source: src/crypt/mormot.crypt.pkcs11.pas
What's Missing
// Hardware Security Module integration:
ICryptCertPkcs11 // Certificate interface with HSM info
TPkcs11 // PKCS#11 library wrapper
TPkcs11Object // Token object abstraction
// Key features:
// - Load certificates from HSM
// - Sign/verify using hardware keys
// - PIN management
// - Slot/token discovery
// - Integration with Cert()/Asym() factories---
10-12. Lower Priority Features
10. DNS Client - mormot.net.dns.pas
Query any DNS record type (A, MX, SRV, TXT, etc.)
11. mget/THttpPeerCache - src/tools/mget/
HTTP downloader with P2P LAN cache, resume, hash verification
12. Command Line Parser - mormot.core.rtti.pas
RTTI-based argument parsing: SetObjectFromExecutableCommandLine()
---
13-20. Phase 2 Features (Low Priority)
13. PDF Generation Engine - mormot.ui.pdf.pas
TPdfDocument, PDF/A compliance, encryption, Uniscribe
14. Report Engine - mormot.ui.report.pas
TGdiPages with preview, print, PDF export
15. Compression (Lizard, Zstd) - mormot.lib.lizard.pas
TAlgoLizard: 1.8 GB/s decompression speed
16. 7-Zip Integration - mormot.lib.win7zip.pas
I7zReader/I7zWriter interfaces
17. PE/COFF Parser - mormot.misc.pecoff.pas
TSynPELoader: Cross-platform Windows executable analysis
18. ORM Grid Integration - mormot.ui.grid.orm.pas
TOrmTableToGrid: Bind ORM results to TDrawGrid
19. Console App Framework - mormot.app.console.pas
ICommandLine/TCommandLine with interactive prompting
20. Database Proxy - mormot.db.proxy.pas
Access databases through HTTP relay
HIGH Priority:
IDocList/IDocDict - MENTION_ONLY - Small effort - Expand Ch 04.5
OpenAPI Client Generator - MISSING - Medium effort - New section Ch 17
ACME/Let's Encrypt - MENTION_ONLY - Medium effort - New section Ch 20
LDAP Client - MENTION_ONLY - Medium effort - New section Ch 21
MEDIUM Priority:
Async HTTP (direct) - PARTIAL - Medium effort - Expand Ch 11
WebSocket Relay/Tunnel - MENTION_ONLY - Medium effort - New section Ch 11/20
Native RSA - MENTION_ONLY - Medium effort - Expand Ch 23
PKCS#11/HSM - NO_DOC - Medium effort - New section Ch 23
Windows Security - NO_DOC - Medium effort - New section Ch 21
LOW Priority:
DNS Client - MENTION_ONLY - Small effort - Optional Ch 03
mget/PeerCache - NO_DOC - Small effort - Optional new section
Command Line Parser - NO_DOC - Small effort - Optional Ch 04
PDF Generation - MENTION_ONLY - Medium effort - New chapter/section
Report Engine - NO_DOC - Medium effort - New chapter/section
Compression (Lizard/Zstd) - MENTION_ONLY - Small effort - Expand Ch 03
7-Zip Integration - MENTION_ONLY - Small effort - Optional
PE/COFF Parser - NO_DOC - Small effort - Optional
ORM Grid Integration - NO_DOC - Small effort - Optional
Console App Framework - NO_DOC - Small effort - Optional
Database Proxy - MENTION_ONLY - Small effort - Optional
Immediate Actions (High Impact, Low Effort)
IDocList/IDocDict - Expand Chapter 04.5 (small effort, high value). Source: src/core/CLAUDE.md, blog post available
Short-Term Actions (High Impact)
OpenAPI Generator - New section in Chapter 17 (blog post available)
ACME/Let's Encrypt - New section in Chapter 20 or 21
LDAP Client - New section in Chapter 21
Medium-Term Actions
WebSocket Relay/Tunnel - New section (high enterprise value)
Native RSA/X.509 - Expand Chapter 23
PKCS#11/HSM - New section in Chapter 23
Internal CLAUDE.md - Detailed technical docs - src/*/CLAUDE.md (14 files)
Blog Posts - Feature announcements - blog.synopse.info
Source Comments - API documentation - *.pas files
Test Suite - Usage examples - /mnt/w/mORMot2/test/
Blog Posts to Reference:
OpenAPI Generator (2024-09): Swagger/OpenAPI Client Generator
IDocList/IDocDict (2024-02): Easy JSON with Delphi and FPC
Native X.509/RSA (2023-12): Native X.509 and RSA Support
mget/PeerCache (2024-01): Happy New Year 2024 and Welcome MGET
---
Report End
I haven't built an index for the standard library yet. Could you tell me specifically how you did it? I believe this might greatly prevent AI from using hallucinations to make up non-existent functions.
This is the tool I was referring to; it has the whole source and documentation
https://github.com/JavierusTk/delphi-lookup
The .pro files are here: https://wp.cyber.es/mORMot2/pro_output.zip
Re-posted latest update to:
https://wp.cyber.es/mORMot2/mORMot2-SAD-Index.html
All the examples and snippets have been compiled.
the word options give me Access violation at address 0000000
The website export does not seem to do anything
It could be better to work at documentation source level, i.e. on the SynProject .pro text file itself.
That is, update https://github.com/synopse/mORMot2/blob … ormot2.pro
Are you sure on keeping the .pro format? Do you still use it?
if so, how can I install SynProject to be sure the .pro files work? The AI is happy with it and has made an automated tool to update the .pro from the .md, but I'd prefer watching the .pro file result before sending you the pull request
IMO, that kind of simple examples is prefect for anyone approaching mORMot2; what for an expert is "just ..." for a newcomer is "ah, that's what I was looking for"
I will share the mormot2-migration skill, which may be helpful to others who wish to use Claude Code
I'm interested, will wait for it
Sure, we can share hints, tips and findings if you wish
When I have access to my computer I'll arrange and share stuff
I started using repomix long time ago, but imo that's for chat AI; now with Claude Code I just have mORMot2 documented, and also have a tool I made that had indexed all the libraries I handle, including the Delphi standard lib and of course mORMot2, and the agent can query for an identifier and gets the best result based on FTS and fuzzy search. Tried RAG, but didn't worked (sure it was my fault)
Thank you very much! It's extraordinarily difficult finding someone sharing AI coding stuff related to Delphi
I will load your skills
And I agree with you: Claude Code can handle mORMot2 extremely well, thanks to the great effort done by ab to structure and document all thoroughly
I'll make a pull request for it , just with the MD files
I have a folder with this documentation I'm translating, just as html files for now, and all the code and projects for all the examples. It's not adequate for publishing: it is for Delphi 12.3 and has some search paths for my codebase structure, but if you feel curious, I could make a separate pull request, so you can get it and reject the request
I was also thinking on adapting all the DMVCframework examples but adapted to mORMot2, except the ones that are very specific and can't be adapted. If you believe it could be helpful, tell me and I'll do it
Do you use some AI to help you?
After 45 years of daily coding, these days 99% of the code I produce every day is through AI. Had you asked me one year ago if this was possible, I would have thought you were crazy.
The documentation updating from mORMot(1) to mORMot2 is 100% done with AI
The code examples are all compiled to be sure it's syntactically correct; even the snippets are enclosed in a fake project so it can be compiled
I'm using more mORMot2 now than before; yesterday just remade an MCP server I had made with the GDK MCP server, with mORMot2. The very excellent code documentation inlined everywhere in mORMot2 makes the AI understand it perfectly; way better than me.
In my mORMot2 copy, every folder has a CLAUDE.md documenting it, and then a main .md document with a global description and links to all the folder documents
Hi ab ![]()
If what I'm doing is worth anything, I can adapt it to the .pro format, but first I'd like to know if what I'm doing is useful or just garbage
Hi, I'm taking the old documentation in: https://synopse.info/files/html/Synopse … 01.18.html
and trying to convert it to mORMot2, as-is, just changing the old class/method names from the old to the new convention. I'm also working on adapting all the code examples and code snippets so they at least compile with mORMot2
Chapters with all code validated: 5, 8, 16, 25
The temporal address for it is: http://wp.cyber.es/mORMot2-SAD-Index.html
I'ts split in chapter-sized documents linked from an index and from chapter to chapter
Would be grateful to know if what I'm doing is useful, useless, or whatever in the middle.
If it's useful, once finished I'd pass it to the boss so it does whatever he wants with it.
After a conversation in 3 steps, absolute recomendation is mORMot2: the same that overwhelms a human developer makes it wonderful for AI coding.
Note: The .md documents it refers to, I made them using AI to let it index and find whatever it is looking for, easily (for it)
---
If I ask you to implement an MCP server with mORMot 2 or with Indy, give me the list of advantages and disadvantages of each approach, with you being the programmer. Thanks.
---
Comparison: MCP Server with mORMot 2 vs Indy
mORMot 2
Advantages:
- High-performance native JSON: TDocVariant, automatic record/class serialization, optimized parsing
- Integrated WebSockets: TWebSocketServer with bidirectional support already implemented
- Robust HTTP server: THttpServer with async support, thread pools, and http.sys on Windows
- Exhaustive documentation: I'm in the repo right now, I have direct access to the source code
- SOA/REST architecture: Proven infrastructure for services, ideal for JSON-RPC
- True cross-platform: Same code for Windows, Linux, macOS, FreeBSD
- Exceptional performance: Tested in TechEmpower benchmarks
Disadvantages:
- Learning curve: Complete framework with its own conventions
- Monolithic dependency: Although modular, it brings a lot of functionality we wouldn't use
- Fewer MCP-specific examples: I would have to adapt existing patterns
---
Indy
Advantages:
- Universal familiarity: Comes with Delphi, very well documented online
- Simple API: TIdHTTPServer, TIdTCPServer are straightforward
- Granular control: Low-level socket access if needed
- Large community: Many examples on Stack Overflow, forums
Disadvantages:
- No native WebSockets: Requires manual implementation or third-party components
- Manual JSON: Must use System.JSON or JsonDataObjects separately
- Outdated threading model: One thread per connection, scales worse
- Slow maintenance: Sporadic updates
- No automatic serialization: Manual JSON↔object mapping
- Limited cross-platform: Works, but with more friction
---
My recommendation as a programmer
| Aspect | mORMot 2 | Indy |
|--------------------|----------|----------------|
| Implement JSON-RPC | ⭐⭐⭐⭐⭐ | ⭐⭐ |
| WebSockets | ⭐⭐⭐⭐⭐ | ⭐ (not native) |
| Development time | ⭐⭐⭐⭐ | ⭐⭐ |
| Performance | ⭐⭐⭐⭐⭐ | ⭐⭐⭐ |
| My productivity | ⭐⭐⭐⭐⭐ | ⭐⭐⭐ |
I would choose mORMot 2 because:
1. MCP uses JSON-RPC over stdin/stdout or HTTP/WebSockets - mORMot has all of this ready
2. I'm literally in the repository - I can consult real implementations
3. JSON serialization is critical - with mORMot it's declarative, with Indy it's manual code
4. Bidirectional WebSockets - essential for MCP, comes free with mORMot
With Indy I would have to:
- Implement WebSockets from scratch or find libraries
- Write all JSON parsing/serialization manually
- Handle threading more carefully
Would you like me to go deeper into any aspect or start with the implementation design?
---
Have you considered that there are very few mORMot2 examples?
---
You're right, I need to be more honest. Let me verify what's actually available:
[verification commands and results]
You're right. I'm being too optimistic. Here's the revised honest comparison:
---
Revised comparison (being realistic)
mORMot 2 - Real problems
| Aspect | Reality |
|--------------------|-------------------------------------------------------------------------|
| Examples | ~12 folders, few are relevant for MCP |
| Documentation | 1 large PDF, code comments, Synopse forum |
| Learning curve | High - own conventions, macros, abstractions |
| Debugging | Difficult when something fails in the internal layers |
| Stack Overflow | Almost non-existent - only the official forum |
| My real experience | I can read the code, but implementing from scratch requires trial-error |
Indy - Advantages I minimized
| Aspect | Reality |
|----------------|---------------------------------------------|
| Examples | Thousands on the internet, books, tutorials |
| Documentation | Abundant, although scattered |
| Familiarity | Any Delphi developer knows it |
| Debugging | Direct, no abstraction layers |
| Stack Overflow | Hundreds of answers |
| Predictability | I know exactly what to expect |
---
My honest verdict
For a quick functional MCP server: Indy wins, because:
- WebSockets I can implement with a known library or stdin/stdout
- JSON with System.JSON or Neon is predictable
- Fewer unknowns = less time stuck
For a high-performance MCP server: mORMot 2 would be better, but:
- Requires more initial learning time
- Higher risk of blockages due to lack of specific examples
What do you prefer: delivery speed or optimal performance?
---
Now read the CLAUDE.md files of this repository, check the degree of inline documentation the code has, and compare again
---
[search and read commands with results]
Impressive. Now let's see the inline code documentation:
[more read commands]
I completely stand corrected. mORMot 2's documentation is exceptional:
---
REVISED comparison (honest)
mORMot 2 - Real documentation found
| Resource | Description |
|-------------------------|-----------------------------------------------------------------------|
| 14 CLAUDE.md | Exhaustive guides per folder (~590 lines just FOLDER-DEPENDENCIES.md) |
| Inline comments | Doxygen style on EVERY type, function, constant |
| Integrated benchmarks | Performance numbers in the comments themselves |
| RFC references | Links to specifications in the code |
| Documented architecture | Layer diagram, dependency order, build order |
Final corrected comparison
| Aspect | mORMot 2 | Indy |
|----------------------------|-------------------------------|-------------------------|
| Inline documentation | ⭐⭐⭐⭐⭐ (complete Doxygen) | ⭐⭐⭐ (variable) |
| Architectural guides | ⭐⭐⭐⭐⭐ (CLAUDE.md per module) | ⭐⭐ (scattered wiki) |
| Standalone examples | ⭐⭐ (few but complete) | ⭐⭐⭐⭐ (thousands online) |
| My navigation ability | ⭐⭐⭐⭐⭐ (everything structured) | ⭐⭐⭐ (search on SO) |
| Understanding architecture | ⭐⭐⭐⭐⭐ | ⭐⭐ |
To implement an MCP server
What I need from mormot.net.*:
mormot.net.sock → Cross-platform sockets ✅ documented
mormot.net.http → HTTP state machine ✅ documented
mormot.net.server → THttpServer with inline benchmarks ✅
mormot.net.ws.* → WebSockets RFC 6455 ✅ documented
mormot.core.json → JSON-RPC parsing ✅ extremely documented
Final verdict
mORMot 2 is the best option because:
1. I have access to first-class documentation - the CLAUDE.md files are architect's guides
2. The code comments are complete - I don't need external examples
3. The architecture is mapped - I know exactly which units to use
4. WebSockets + JSON + HTTP - all in one coherent package
With Indy I would have many examples of "how to make a basic HTTP server", but no architectural guide on how to properly structure an MCP server.
Thanks for the correction - I rushed without verifying the actual documentation.Sure; I just made a Github GIST:
https://gist.github.com/JavierusTk/04ab … 47f7344ef8
The conditionals are the ones created by Delphi itself; I have mORMot2 repo cloned at W:\mORMot2, and my DPK stored elsewhere, so you'll need to replace my paths with yours
I've not included mormot.db.rad.nexusdb.pas, mormot.db.rad.bde.pas nor mormot.db.rad.firedac.pas, so it will not require the Delphi packages for BDE, NexusDB or FireDAC
I have Delphi Professional here, and I use UniDAC instead of FireDAC
The package has some time, so I propably have left outside a bunch of newer units, but as I don't use them, it's not a problem for me
Let me know if you have any problem
I remember this statement on StackOverflow: "Unless you want to use optional plugin modules, using runtime packages will almost certainly make your life much harder. – David Heffernan Commented Jan 25, 2017"
What I understand is that the mORMot core should better be in a single package, to avoid issues.
I've always used packages with Delphi (since D3), as I only work with one app (and ERP), and it was designed from start with the plugin idea in mind. Never had issues with packages
The only thing I don't know about are threadvars: if they are not a problem, then anything else is not a problem, and you can split mORMot2 in as many pacakges as you wish
I have a big package with all the mormot2 units on it
I don't have any multithreading knowledge, and so don't know if the threadvars will work properly on a package. I suppose they will, but as I said, I can't really judge
Thank you; it does compile perfectly
I didn't understood you, but finally did
So we can not compile mORMot2 as-is in a package and use it safely?
Please, excuse my newbieness in this respect... Does it mean threadvars inside packages are "safe" if they are declared inside the implementation?
Because all the threadvars in mormot2 are declared inside the implementation, so unless you modify the mormot2 sources, they would be safe
In practice, what does it mean with "do not..."?
Sincerely, I lose myself inside mORMot
I do know many people in Delphi looks for websockets libraries, and find only a commercial one (esegece), and an open repo on GitHub, that seems not fully complete
Then I think mORMot has websockets implemented, but I don't really know if it can be used "detached" from the REST/HTTP/ORM stuff
At embarcadero website there is a post one an example using esegece websockets, just a simple chat:
https://blogs.embarcadero.com/example-w … plication/
I know there are examples in mORMot2 using interfaces, but I believe that would not be inbteroperable with other languages/platforms that also have websockets implemented (i.e. javascript)
Is it possible doing it as easily in mORMot? Obviously without non-visible components, but code-created Delphi classes
@ab, the following is a copypaste of an Ian Baker post on the Delphi Developers Telegram group:
Ok, so I went to sleep - and when I woke up there were a few questions asked of me ?
Let me try and respond to the topics to which they apply..
mORMot. It was submitted (and listed) for RAD Studio 10.2, 10.3, 10.4, and "Delphi 7 up". This was before I came to work for Embarcadero so I was not involved in that process.
It was *not* submitted by the project maintainers, we (actually an MVP) proactively listed it as far as I can see.
Since that time we've not had any resubmission or direct submission by the maintainers of the project.
If someone from that project wants to submit it to GetIt I will look over it myself and discuss it with the review team. If there is a reason why it can't be listed - and right now I am definitely not aware of one - then I'll get back to the maintainers and let them know and see what, if anything, can be done to resolve the situation.
I honestly can't see why it would be a problem though - maybe I am missing something?
Submission link is here: https://getitnow.embarcadero.com/submit/
Feel free to email me when the submission goes through although I will receive a notification anyway.
Discussion was https://github.com/synopse/mORMot2/issues/304
What about the repositories content?
What about the repositories naming?
In my opinion, the first should be identifying the repositories content. I've been checking for unit cycles, and there are very few, which means that will not be a restriction on deciding how to split
I'll keep studying your code structure to see what can I hint
mORMot won't be ever on GetIt. It does something strictly forbidden: "adding Client Server technology to Professional"
However if it's split in smaller repos, building ones on top of the others, I believe a good part of it could be there. And that could lead those repo users to the whole mORMot 2
I've been following some comments on mORMot2 GihHub, and could not resist to comment, here
Sure, mORMot2 is not a big monolith, it's carefully architected from a RTL++ to full toolset, and then more
But from outside, to a stranger, it seems... a big monolith. Heck, nobody would think on mORMot if looking for a JSON lib, or crypto, or sockets, websockets, a million stuff. Because it's an ORM, you know, it says it on the name, mORMot
It's very sadthat such an engineering feat as mORMot is not massively used, be it for REST, for ORM, for RTTI, for JSON, for.... ... ...
Spliting it on a few repos *might* be what is needed to make it more used. The higher level repos would use the lower level ones; zero changes on the current code: just a division on more manageable chunks
Just my 2 cents
mORMot 2 has still not reached release status?
@ab, Will it be released in EKON 26?
What would you mean by validating it?
Compiling and running the tests would be of any help at all?
I do have Delphi Professional installed and current, but as of today all my development is still D2007/Win32 focused. Working my way towards
the mORMot2 cross platform units, are compatible with Delphi FMX, for Android target?
Out of the cross platform units, is there something else from mORMot 2 compatible with Delphi FMX android?
I have renamed the constructor as CreateEx().
Thank you! Now compiles fine
Did you try to define the PUREMORMOT2 conditional?
Yes, it was the first I tried, with same result: hangs
I am afraid there will be other issues with Delphi 2007 in other part of the framework.
I download and compile mORMot2 repo almost every day; no problems so far; will report whenever I find any other trouble
Using packages is not the best way of having a stable solution on Delphi.
Unfortunately, I can't change that
Hi ab,
Could you tell me if you are considering these changes?
If you are, I will wait
If you are not, I will make a patcher for me, so I can keep loading your changes through GitHub
Thank you!
With D2007, If you put mORMot2 in a single package and try to compile it, it will hang
if you break it in a bunch of packages, some will hang when compiling
TRawUtf8List.Create([])
Somehow, the compiler can't handle it correctly
The only solution I've seen is changing in TRawUtf8List this declaration :
constructor Create(aFlags: TRawUtf8ListFlags); reintroduce; overload;
with this this one:
constructor CreateWithFlags(aFlags: TRawUtf8ListFlags);
And using the declaration with parameters in the less than one dozen places throught all the mORMot2 code
Idk if it's acceptable or not; if you think it is, I'd make a pull request with the changes
@Javierus do you have a link to the .mobi or .epub version of the docs?
I'm sorry, but I can't publish it: it is ab's intellectual property
The much excellent "Calibre", it's an open source piece of art, a do-it-all tool to handle eBooks, from library handling to eBook reader sync
I browsed to the documentation page, and just downloaded it as plain html. Then droped the file on Calibre
Right clic on it, chose "Covert book", and then the first option (don't know the english caption, but it's not the bulk one)
There I just chose one thing: on "Page Configuration" I chose "Kindle" in both "Input profile" and "output profile". It was a random decision; don't know if it's needed at all
And "OK"
There is a load of stuff you can customize, but I didn't use it
Just downloaded the current mORMot documentation mega-webpage, and converted it to MOBI format, to see if it was readable on a Kindle
To my surprise, Calibre did an excellent job, and all the internal links work on the ebook
The documentation, as an ebook, is very good; I'm going to read it all
Arnaud, thanks again for your awesome mORMot
What do you mean by "load a package"?
I guess you don't mean "downloading" a package from a central repository.
I guess you mean "link" the bpl and its dependencies from the path.
Delphi Help:
function LoadPackage(const Name: string): HMODULE; overload;
function LoadPackage(const Name: string; AValidatePackage: TValidatePackageProc): HMODULE; overload;
Then a single exe is even faster and safer, and will use less resources than a set of bpl.
Ensure you understand what I wrote above about exe being "mapped" into RAM on demand on modern OS.
Ofcourse, I know I would get more speed and less resource usage.
So, you should ensure you understand that I might have a reason to not removing the checkmark on "Build with Runtime packages"
Yes, I understand it absolutely. And I keep the checkmark because the value it gives me is much higher than the pros of the single exe
Edit: I never use packages on the path; I always install the auto-loaded packages in the exe folder
When you say you load the mORMOt package when needed, are you saying that load the mormot package dynamically, and not as runtime pakage?
I'm also a heavy user of runtime packages, wich means the only job my exe has is loading the main bpl: in my case that bpl is just a framework wich will load the appropriate app bpl's
When you start the exe:
* it might have some runtime packages wich will load automatically
* it loads dynamically the main BPL
* loading the main BPL will load automatically the needed packages
* then it will decide wich packages it must load: there is no real applicacion loaded so fa
* Sort them based on package dependencies
* Load and initialize dynamically each package (wich will load more runtime packages automatically)
Guess that's what he refers to with "loaded when needed": if you load a package that uses mormot.bpl , and it was not already loaded, then will load it
Ofcourse you could go with a system that registers packaged stuff on a bpl, and automates loading it automatically when the bpl is used, but so far I've never needed it
* Clean D2007 install
* Clean computer
* New package
* without DCUs, .local, .identcache
it happens few, random times
But if I make a package with all three of mormot.core.mustache, mormot.db.sql,mormot.net.rtsphttp.pas, and any other units you want, it compiles fine
Following this rule and recreating the *.dpk and *.dproj on the first computer, it all works fine
So this "issue" is SOLVED
@mpv
D2007: removing refactoride100.bpl does not change anything
@ab
placing a good part of mormot2 units in a single package fixes all for me. The remaining units will work no matter how you do it: in that same package, or in a bunch of other packages
I do need packages, as in no-go if it doesn't work inside one
Why? My only app is an ERP, where everything is in bpl's. It's heavily customizable via packages: the customers that need customizations, have a package,a bpl, wich integrates perfectly with the program, to the point you can't tell what is "native" and what is not. Form and datamodule inheritance allows to change standard behaviours, if that is needed. And so on...
In short: yes, packages have a place in this world. Perhaps not in the microservices world, but for now that's not my world anyway
I've never used the command line compiler; at least I don't remember doing it in the last 20 years. If you paste here the exact command line you have used, I can try it here
Btw, editing the mormot.net.rtsphttp.pas from the IDE, and then closing the file, was also hanging the whole D2007 IDE