#1101 Re: mORMot 1 » Asynchronous CRUD operations? » 2014-05-20 03:26:21

@ab,

I think I just got my answer by a reply of yours in another topic, by setting the following:

TSQLRestServerDB.AcquireExecutionMode[execORMWrite] := amBackgroundThread

And all the writing to the sqlite3 db will be run in another single, dedicated background, thread, right?

#1102 Re: mORMot 1 » Will ExportServerNamedPipe() make the server runs another thread? » 2014-05-19 16:04:47

Thanks, ab, one more question, if you don't mind.

If I define a server side function, eg, TSQLRestServerDB.Sum(), will this  function runs in the thread created by ExportServerNamedPipe() ?

#1103 mORMot 1 » Asynchronous CRUD operations? » 2014-05-19 15:25:24

edwinsn
Replies: 8

Hi Arnaud,

Can the object CRUD operation be asynchronous?

My application is a standalone program, some  threads will download something from the Internet and let the ORM server (using the named pipes protocol) to save the data.

And I don't want those 'downloader threads' to wait for the ORM server to finish saving data, but just post the job to the ORM and forget.

#1104 Re: Delphi » "Native" means CPU-native... even Microsoft admits it! » 2014-05-18 15:53:46

I noticed the .Net Native news few weeks ago, and it really got my attention. I'm quite sure it can be very compelling, at least to me, if it finally supports the entire .Net framework for desktop, given the fact that Visual Studio and the .Net framework, both are so far ahead of the Delphi IDE and VCL, and c# is a nice language, so if the speed thing can be fixed, it'll be amazing. But who knows if MS will finally get to that point.

#1105 Re: mORMot 1 » Will there be TSynLog and TMemoryMapText for linux OS ? » 2014-05-18 15:38:44

BTW, how do you use CrossFPC? Their website nor Google do not have any tutorial. I tried install it, the only I found it adds to the Delphi XE4 IDE is an option window, but I couldn't figure out how to create a project for a specified platform, say Linux, nor I couldn't find out how to specify a target platform that it supports. At the end I uninstalled it...

Any body has any hint on this?

#1106 Re: mORMot 1 » Will ExportServerNamedPipe() make the server runs another thread? » 2014-05-18 15:34:01

thanks for the info, Arnaud.

PS 1, it seems that a windows message-based server (ExportServerMessage()) doesn't work inside a TOmniWorker (of OTL - OmniThreadLibrary), I tried that, and when a client access that server from the main thread, the program will hang. Maybe it conflicts with OTL's message loops... Anyways, just a report to you, I use the named pipe protocol now.

PS 2,  you seem to use the term 'GDI message', but a Google search didn't show any results about it, I guess the more proper term should be 'win32 message', or 'winapi message', or 'Windows message'? This occurred to me when replying you, so I figured I'd mention it smile

#1107 Re: mORMot 1 » Will ExportServerNamedPipe() make the server runs another thread? » 2014-05-18 14:22:06

One more question, ab, ExportServerMessage() doesn't create its own thread, right?

#1108 mORMot 1 » Will ExportServerNamedPipe() make the server runs another thread? » 2014-05-18 11:29:20

edwinsn
Replies: 7

Hi Arnaud,

In my standalone program, I'm creating running TSQLRestServerDB.ExportServerNamedPipe() in a separated thread, but just now I checked the source code of that function, it seems that ExportServerNamedPipe() will create another thread.

Does it mean I can simply run ExportServerNamedPipe() in my the main thread, and the server will automatically runs in a separated thread?

Couldn't find related info in the manual. Sorry.

#1109 Re: mORMot 1 » Could you help to comment on the Brook framework ? » 2014-05-17 09:24:37

@ab, I'm sorry if my previous reply contains too strong languages smile

Thanks for the reply, your example code given above made me realized that, the document I started reading few days ago was old and the latest one is 1.18, and you know what? Few days ago I started integrating mORMot into a new program, and I have been getting WOW-effects - it's so powerful and easy to use (with the help of the supplied examples), and your example above made me downloaded the latest doc and found it's so easy to implement 'remote functions'!

Yes, I really like the 'convention over configuration' philology in mORMot which was popularized by RoR.
And yes, I really like the ' batteries included' feature of mORMot, it is so powerful!

Actually, in terms of feature-rich, mORMot is quite far ahead of Brook, while keep still its simplicity.

That being said, I wasn't actually comparing the two, all after all, they exist in two different platforms, and actually I was only commenting on your 'toy' comment, please don't get offended.

PS, I really wish mORMot will support Lazarus/FPC soon, that's cross-plat form! And I'm actually considering abandoning the VCL UI of the program I mentioned above, and make a standalone http server app, and keeping the code FPC-ready, so that one day mORMot become FPC-compatible, my app will become cross-platform. Why not? I've got my own little LIVEditor (http://liveditor.com) to develop the front end (ok, not quite ready, but it will ) tongue A nice dream, isn't it wink

#1110 Re: mORMot 1 » Will there be TSynLog and TMemoryMapText for linux OS ? » 2014-05-17 08:00:52

ab wrote:

Perhaps we will release 1.18 soon.

Then start 2.x branch with cross-platform in mind.

@ab, that's a good news! You are always great, as usual smile

#1111 Re: mORMot 1 » Will there be TSynLog and TMemoryMapText for linux OS ? » 2014-05-17 07:03:11

ab, it won't be only you'll use or want to use mORMot under Linux, the server worlds has been dominated by Linux for years now, right?

I, for one, do strongly wish mORMot will fully support Free Pascal, why? Because I can write a web app that runs on Windows, Mac OSX and Linux and expose the UI via whatever web browser the user uses! It'll be amazing!

mORMot almost contains almost everything we need to make a web app - the standalone http server, the URI routing module, it's  RESTful nature, the ORM, the interfaces to many major DBMS (even including the cutting edge MongoDB), the Mustache template engine, and so on.

When it's FPC-ready, an announcement in the FPC forum will prove what I said above.

#1112 Re: mORMot 1 » Could you help to comment on the Brook framework ? » 2014-05-17 06:50:22

ab wrote:

Not much to see in this project yet...

Sounds more like a toy library to me.
For instance, the opf is a joke and features are pretty basic.

@ab, with respect, I think what you said is not fair to the brook framework.

Although I have not fully evaluated and test it, IIRC, just like Python's popular and elegant Flask web framework (http://flask.pocoo.org/), I guess Brook fro FPC is also inspired by the Sinatra framework for Ruby (http://www.sinatrarb.com/).

Actually, almost every mainstream languages has one or more Sinatra-inspired web framework that are quite widely used, well, except Dephi (http://en.wikipedia.org/wiki/Sinatra_(s … by_Sinatra)

That being said, the philosophies beyind all those Sinatra-inspired frameworks like brook are:

  **simplicity** and **flexibility**

A quote from the wikipedia: the goal is to "quickly creating web-applications with minimal effort."

Want to use another ORM or data persistence library? No problem, and most importantly - it's easy and simple from the coder's POV, since usually you can just plug-in an extension or module.

In additional to **simplicity** (which has/is always a good thing and nowadays people embrace ), another benefit of Brook is **cross-platform**. (well, I really wish mormot will fully support free Pascal in the near future!)

What I said above doesn't remove my praise to mORMot, of course, but saying brook is a toy is far from fair.

#1113 Re: mORMot 1 » hello world mustache » 2014-05-11 09:16:50

Arnaud, Python's Flask framework is very elegant, IMHO: http://flask.pocoo.org/

ab wrote:

I'm currently investigating several ways of doing simple web apps.

What I want to do is implement the MVC pattern with interface-based services.
There are several feature request tickets about this.

I would like to have the same exact Controller and Model code work:
- either as a Delphi client (with regular VCL forms for the view);
- or as a web application (with Mustache templates for the view).

Since even the VCL forms will be void of any logic, we may even try to auto-generate the web views from the VCL forms themselves, for simple apps...

#1114 Re: mORMot 1 » hello world mustache » 2014-05-10 10:21:45

The way ASP works has proved to be a mess due to it mix logics in the html markups, and that approach have been abandoned nowadays.

What makes the Mustache template engine appearing, is that, it's **logic-less**, the philosophy is that, no program logics in the template markups.

In your case, you can just use a js function,  to handle the click event, and in that js function talk to the mormot server.

I think we should stick with standard and proven technologies.


warleyalex wrote:

This mustache is fucking cool. I created a mini pizza order menu using mORMot with mustache.  I have the list of pizzas in a menu, when user, for example, select/order a pizza and click <Buy this> another template is rendered. 
Of course, I'm using JS (the onclick attribute on my anchor tag). However, I've been thinking it would be really nice to have some basic mORMot controls instead of regular html controls: a server-side control, like in ASP.

<a href="#" runat="server" onServerClick="MyFuncion_Click" />

My opinion is that server-side rendering will almost always be faster than client side rendering.

#1115 Re: mORMot 1 » Compile in Lazarus » 2014-05-10 10:13:45

Free Pascal support definitely will be great, since then we'll be able to run our REST sever on a LINUX server or a Max OS machine!

#1116 Re: mORMot 1 » Mustache Logic-less templates for Delphi » 2014-05-10 07:09:52

Arnaud, yes, the Synopse framework is very well organized already!

And I didn't describe that 'perfect world' well. Simply put it, in a perfect world, we'll have a dependency/package manager like Maven for Java (http://stackoverflow.com/a/3589974), and all Delphi libs are comply with it... Well, just a dream smile

#1117 Re: mORMot 1 » hello world mustache » 2014-05-09 14:41:52

ab wrote:

I'm currently investigating also about http://goratchet.com/ and http://getbootstrap.com/ for application theming, since I'm definitively no CSS expert!

Hi Arnaud, I'm no CSS expert too, and I found that the HTML inspector in Firebug or DevTools  to be indispensable for CSS thing, and that why I am developing LIVEditor (http://liveditor.com) which has a similar 'css inspector and locatior' included, just in case you find it may help, contact me and I'll be pleased to send you a free license smile

#1118 Re: mORMot 1 » propsal from Newbie to mORMot » 2014-05-09 14:37:52

Hi Arnaud, I am actually embracing speed and performance like you!

ab wrote:

I did not knew about Evernote.
http://www.itwriting.com/blog/3385-less … m-net.html is kind interesting.
It reflects my own experiment.

But honestly, the new Visual Studio is just a hardware killer: you need a high-end PC with a lot of memory to use it.
Even the latest Delphi IDE is more responsive!
If you compare with Delphi 7 or 2007 - this is another planet of speed. And why I still use a lot Delphi 7 as my main IDE.

#1119 Re: mORMot 1 » Mustache Logic-less templates for Delphi » 2014-05-04 06:09:58

ab, it's good to see you took this step!

Well, in a perfect world, we'll have small, standalone but interface-able libraries, like how node.js mange its modules.

In a perfect world, we'll have:
1 - SynpseFundamentals, which includes SynCommons.pas, Synnopse.inc, etc.
2 - SynpseSpiderMonkeyWrapper...
3 - SynpseMongoDbClient...
4 - SynpseHttpClient...
5 - SynpseHttpServer...
6 - SynpseORM...

And so on...
So it's not only good for marketing, but also good for managing the  dependency, good for people who only want to use parts of the framework.

We all know the JVCL framework, which was heading to another direction over ten years ago. I saw people want to use some of it's components, but were afraid of it's huge size.

ab wrote:

... yes, but all will use SynCommons.pas, SynLZ.pas and Synopse.inc...

All is available within mORMot source code repository,  but the units are decoupled.
Several web sites may help, but only for marketing purpose, IMHO.

#1120 Re: mORMot 1 » propsal from Newbie to mORMot » 2014-05-04 06:04:02

ab, this is really a nice approach by having a synced repository for other people, we you keep the convenience you already enjoy with fossil.

Re git client, I use the official git which has some Windows Explorer integration, it should be much fast and lightweight that github for Windows, although I've never installed the latter - I never liked bloatware, especially slow-bloat-ware, nor I have got many good fast experiences with .net-powered software.

If you have used Evernote for Windows for enough long time, you must know that few years ago they completely re-written it in c++ and replaced the old one that's written with .net, just for the sake of speed and performance. They had a blog post IIRC.

#1121 Re: mORMot 1 » AV SpiderMonkey Mustache rendered failed » 2014-05-04 05:45:02

it's working here when I tried it about a week ago.

#1122 Re: mORMot 1 » Mustache Logic-less templates for Delphi » 2014-05-01 13:30:09

ab, actually, maybe you should also create separate repository for other detach-able bits of in the synopses library, such as the BSON implementation, the mongodb client library, the standalone http servers, etc. Nowadays single-purpose libraries is a trend - just check the node.js/python libraries, and I always liked it.

#1123 Re: mORMot 1 » Mustache Logic-less templates for Delphi » 2014-05-01 13:21:27

ab wrote:

@edwinsn
Our SynMustache is already listed to the official page http://mustache.github.io/
smile

Great! And I wish start to love github - although on my computer I only do git-clones, github's web interface is really helpful for people checking out the source without using any version controlling systems.

#1124 Re: mORMot 1 » How to disable the builtin exception catching ? » 2014-04-29 04:28:51

Hi ab, maybe you missed this reply, Can you still tell me how to disable the exception logging? Thanks.

#1125 Re: SyNode » Adding JavaScript support for mORMot framework » 2014-04-28 16:18:39

mpv wrote:

Yes, we will create patch for Mozilla mercurial repository ASAP. But I'm little bit busy now

Great! And you must know that I'm not pushing you, just need to make sure you'll eventually release it, time frame is not a concern smile

#1126 Re: mORMot 1 » Mustache Logic-less templates for Delphi » 2014-04-28 13:35:39

great job ab! Maybe get this Delphi wrapper listed here: http://mustache.github.io/

#1127 Re: SyNode » Adding JavaScript support for mORMot framework » 2014-04-28 13:33:54

ab wrote:

I received the files so I will update the source code repository soon....

Great job ab and mpv! Yester day I downloaded and it complied and the jshttpserver demo worked.

I've got a question for mpv though, shortly I'll need to make a decision on using the spidermonkey wrapper, one key factor  would be, are you planning to release the source code of the 'c wrapper over the c++' ab mentioned earlier? Thanks.

#1128 Re: SyNode » Adding JavaScript support for mORMot framework » 2014-04-25 05:12:23

Great! Great! You guys!
I'll check the low level API someday.

mpv wrote:

We finish performance problem solving. Regressiin test AB provide also fixed. Tonight we prettify code and describe the root of problem we solv. Also we add ArayBuffer API.
About AST - this is actually a part of Firefox, not SM itself. But on the low level it is posible to do the same operation as in reflect.jsm...

#1129 Re: SyNode » Adding JavaScript support for mORMot framework » 2014-04-23 04:58:40

Hi mpv, does the spiderMonkey dll expose the JS parser API that can generate AST (abstract syntax tree), as described here:
https://developer.mozilla.org/en-US/doc … Parser_API

#1130 Re: SyNode » Adding JavaScript support for mORMot framework » 2014-04-23 03:36:48

is it possible that the problem is coming from the c wrapper?

#1131 Re: SyNode » Adding JavaScript support for mORMot framework » 2014-04-21 15:30:23

ab wrote:

Here we are back!

I've integrated SM 24, and updated the binaries.
See http://synopse.info/fossil/info/687f12d548

What about the small GC-related performance issue?
What about providing the C wrapper source code?

Feedback is welcome!

I suggest mpv to host the  C wrapper source code on github or google code, since it's standalone. And this is really an excellent idea to get around the difficulty of wrapping c++ library using Delphi!

I think I'll be able to test it in the near future tongue

#1132 Re: mORMot 1 » How to disable the builtin exception catching ? » 2014-04-19 07:42:34

ab, I always use my copter with an administrator account smile
screenshot is uploaded: http://screenpresso.com/=kiMec
http://screenpresso.com/=kiMec

Can you still tell me how to disable the exception logging? I prefer madExcept because it's IDE integration. Thanks.

ab wrote:

I never saw it in my tests...

Are you sure you run the server with administrator rights, so that the HTTP.SYS server is used?
Or at least register the URI, i.e. run the server once with administrator rights?
The Socket-based server is not stable enough in high-volume stress test.

BTW, if you enable the detailed map file generation in your project, you won't need MadExcept: the mORMot TSynLog class will log the stack trace of the exception, with all source code line numbers!
The feature is already within our libraries!
For free!

#1133 Re: mORMot 1 » Load testing tool » 2014-04-19 07:36:48

I'm staying tuned!

ab wrote:

I'm currently working on the code mpv sent me.
The supplied regression tests are to be adapted to the new layer.
I will release the source on Sunday, I suppose.

Stay tuned!

#1134 Re: mORMot 1 » How about restrict embarcadero to use/distribute the soure code? » 2014-04-19 07:30:05

ab, it's very kind of you! And this kind of "integration" of 3rd party code is OK - not in terms of legal concerns, I mean at least it not affect the mormot development.

ab wrote:

Embarcadero does have a very precise licensing policy.
They would never incorporate any third-party code without explicit contract with the owner.
Marco takes much care about it.

So IMHO such a license clause in our own licence is superfluous.

There is no risk of EMB blocking the development of our classes.

In fact, there is some part of mORMot code in EMB libraries, I mean I discovered some code I wrote in the AnyDAC/FireDAC SQLite3 wrapper: the static linking explicitly use some code I wrote...
They just deleted the comments...
See uADPhysStatic.pas and compare with SynSQLite3Static.pas...
This is an obvious license break!
I may sue EMB for some lines of code... (and perhaps I should)... But I have something more constructive to do!
smile

#1135 Re: SyNode » Adding JavaScript support for mORMot framework » 2014-04-14 14:17:57

mpv wrote:

It seems we solve performance problem. This is because Garbage collection model is changed in SM24. We need small additional investigation how to tune it.... Commit coming soon..

That's really excellent job mpv!

At a later time I **maybe** (just maybe) benchmark SM with the Besen pure Pascal implementation JS engine wink

#1136 mORMot 1 » How to disable the builtin exception catching ? » 2014-04-14 07:38:45

edwinsn
Replies: 4

Hi ab,

Few days ago I was trying to to test "21 - HTTP Client-Server performance", right after I started the server the red light was on showing me an exception error about system.@DynArrayHigh, and it hang, the Windows 'app crash' system dialog took over.

How to disable the built-in exception logging? I want to  let **madExcept** handle that so that I can dbl-clicking go to the source code in the IDE.

Thanks.

#1138 mORMot 1 » How about restrict embarcadero to use/distribute the soure code? » 2014-04-14 04:09:10

edwinsn
Replies: 2

To ab, mpv and other code contributors,

In the great Delphi chromium embedded  project, the author Henri has a license clause says:

* Embarcadero Technologies, Inc is not permitted to use or redistribute
* this source code without explicit permission.

Henri did that for good reasons, and I remember he had a blog post explaining that (couldn't find it now though).

The concern is, after a third-party library  (be it commercial or open source) becoming a part of the RTL/VCL, no external enhancement is possible. Remember what happened to that open source PNG library? And Bold?

I'm suggesting this because I think there are a lot of gems in this framework (thank you guys!), The spidermonkey wrapper, the BSON implementation, the mongoDB interface, the PDF writer, etc, all are great pieces of software, and especially, ab focuses on **performance**!.

Just my two cents.

#1139 Re: mORMot 1 » Load testing tool » 2014-04-14 03:42:28

Thanks for the write up,  mpv. An Apache installation seems to be cumbersome to me, I might just fire up A Linux VM and ru wrk there.

Actually, at the moment, I'm mostly interested in the SpiderMonkey wrapper, not the mORMot framewok (need not to say, it's excellent!), so I guess the single process openwebload is enough for me to compare the performance between SpiderMonkey versions. It's just me smile

#1140 Re: SyNode » Adding JavaScript support for mORMot framework » 2014-04-13 18:08:27

ok, on my i5/6GB local PC, I just did a load test using a command line tool called openload (http://openwebload.sourceforge.net/) and got the following result, using the nightly build ( I think it's SpiderMonkey 1.8.5):

D:\>openload localhost:888/root/readme.md 1000
URL: http://localhost:888/root/readme.md
Clients: 1000
MaTps 814.00, Tps 814.00, Resp Time  0.138, Err   0%, Count   814
MaTps 907.20, Tps 1746.00, Resp Time  0.074, Err   0%, Count  2560
MaTps 985.53, Tps 1690.55, Resp Time  0.072, Err   0%, Count  4259
MaTps 1056.18, Tps 1692.00, Resp Time  0.079, Err   0%, Count  5951
MaTps 1120.82, Tps 1702.59, Resp Time  0.074, Err   0%, Count  7657
MaTps 1167.62, Tps 1588.82, Resp Time  0.081, Err   0%, Count  9249
MaTps 1208.67, Tps 1578.06, Resp Time  0.080, Err   0%, Count 10846
MaTps 1259.41, Tps 1716.12, Resp Time  0.075, Err   0%, Count 12581

The second column, Tps, is the number of completed requests during a second.

I will do the same test once I got the SM24 version and we'll see how it'll go.

#1141 Re: SyNode » Adding JavaScript support for mORMot framework » 2014-04-13 16:06:54

mpv wrote:

Some part work, some - not. The main problem is setTimeout/setInterval.

Forget to ask: I assume we can implement those two functions as native functions in the Delphi host?

#1142 Re: SyNode » Adding JavaScript support for mORMot framework » 2014-04-13 15:04:50

mpv wrote:
 >wrk -c1000 -t10 http://host:888/root/readme.md 

This is interesting, I want to do a load test here too, I did a google search and it led me to this github repository (https://github.com/wg/wrk), but I'm not sure how to install and use it on **Windows**, any hints?

mpv wrote:
  • - we also include dubugger low-level API in this commit. (GUI part we commit later)

Congratulations on the great work! A debugger API is really a nice addition!


mpv wrote:

@AB - I will definitely find the time to learn Fossil - I use tortioseSVN for last 10 year and very used to the GUI and IDE integration. IMHO this is the main things fossil is missing.
While sending a letter..

Same here, that's why I suggest to move the source code to google code or github, but keep everything here. Just my suggestions.

#1143 Re: SyNode » Adding JavaScript support for mORMot framework » 2014-04-13 03:33:54

Hi ab and mpv,

A new finding: Browserify.org (http://browserify.org/) contains the browser versions of many node modules, and I did not dig deeply, but I guess those modules should work fine with spidermonkey without or with minimal changes.

#1144 mORMot 1 » Suggestion: implement SSE (server sent event) into mormot » 2014-04-12 11:39:00

edwinsn
Replies: 2

Hi ab,

The server sent event is nearly a web standard, and it's very useful to browser clients of the mormot framework, although it should be quite simple to implement, but chance of integrate it directly into the framework?

https://developer.mozilla.org/en-US/doc … ent_events

#1145 Re: SyNode » Adding JavaScript support for mORMot framework » 2014-04-11 14:14:21

@mpv, at the beginning of the development, you avoided v8 because it provides c++ interfaces which is more complex than C API, I think you did not expect SpiderMonkey would drop C API, right?

mpv wrote:

starting from SM24 mozilla drop support for C api (only c++).

#1146 Re: SyNode » Adding JavaScript support for mORMot framework » 2014-04-10 16:33:25

@mpv, thanks for the update. The scale of file size is not a big deal.

@ab, I think it's not about the version control features, but the popularity of the system - how are the client programs? How many good tutorials? I assume many developers have used svn or git already. But I understand the reasons not to switch on your side.

ab wrote:

You can contribute directly on our fossil server http://synopse.info/fossil
GitHub would not offer anything more.
See http://www.fossil-scm.org/index.html/do … v-git.wiki

Contributions are always welcome (we never refused to give a developer access account to our fossil repository), and any external commit is always validated and (most of the time) refactored before integration.
For instance, it should meet our KISS code style and high quality documentation criteria.
When we did input some code of external contribution directly into the trunk, with very small code review and validation, it was much difficult to integrate it later.

Most of the time, we prefer to merge the code here at Synopse.
It allows peer review, avoid most unexpected regressions, and sometimes add a more open way of implementing things.

#1147 Re: SyNode » Adding JavaScript support for mORMot framework » 2014-04-10 11:40:34

Hi Arnaud,

With respect, I assume currently others sending you source code using email, wouldn't it much convenient for communication if the source code is hosted on github.com? Other can contribute to the source too.

ab wrote:

Hello Pavel?

Any news?

:-)

#1148 Re: SyNode » Adding JavaScript support for mORMot framework » 2014-04-10 05:38:05

Great job, you guys!

Can't wait to try this! Is the mozjs.dll file for SM 24 bigger?

Please don't forget to notify us here when it's done and the link to the new mozjs.dll smile


mpv wrote:

AB, the next day (april 8), we plan to merge current version SynSM & SynSMAPI with our new SM24 implementation, so please - do not modify sources.
Full list of changes can to JavaScript be found here:
Changes in SM 18
Changes in SM 19
Changes in SM 20
Changes in SM 21
Changes in SM 22
Changes in SM 23
Changes in SM 24

After this we start to:

  1. redesign our debugger implementation to be contributed to mORMot ( Yes, we have debugger smile )

  2. redesign out TObject descendant import mechanism to be contributed to mORMot

Last allow write in delphi (for "old" RTTI):

TMyClass = class
published
  function write(cx: PJSContext; argc: uintN; vp: pjsval): JSBool; // for OLD RTTI - only this signature of function
  property myProp: integer; // but all kind of property 
end;
TSMEngine.registerClass(TMyClass); 

And when in SM

var inst = new TMyClass();
inst.write('some arg');
inst.myProp;

Also we have the same but for new RTTI - it allow to publish to SM almost all methods of TObject smile

#1149 Re: SyNode » Adding JavaScript support for mORMot framework » 2014-04-04 06:37:06

ab, mpv,  this is just AWESOME!

Since JS is case-sensitive, I assume

showDownRunner

in

engine.Global.showDownRunner(FileName);

must be case-sensitive, right?



ab wrote:

I've added late-binding and a custom variant type for SpiderMonkey.

This TSMVariant custom variant type, can be used to store a native JavaScript object in Delphi, and expose its properties and functions via latebinding.

You can now write Delphi code to execute the showDownRunner() JavaScript method:

   content := engine.Global.showDownRunner(FileName);

Which is the same as the slightly faster:

   content := engine.GlobalObject.Run('showDownRunner',[SynUnicode(FileName)]);

Of course, you can access to any JavaScript's object properties via late-binding:

   engine.Global.myobject.myproperty := 1.0594631; // here myobject.myproperty are accessed via late-binding! 

This works also for parameters to any native Delphi function: when a JavaScript object is transmitted, such variant types are sent to TSMEngineMethodEventVariant callbacks...
So you access all JavaScript object internals in your Delphi native code, just as natural as from JavaScript...
smile

See http://synopse.info/fossil/info/0871fa6785 and http://synopse.info/fossil/info/0baebae5d1.

#1150 Re: mORMot 1 » TDocVariant custom variant type » 2014-04-03 12:21:58

Wow! This is amazing, any possibility of rolling it into a embedded, document-based datastore by combining your bigTable, just like mongoDb, but much lightweight like sqlite, and without the 4gb limit on a 32bit machine? smile

Board footer

Powered by FluxBB