4

Are there any out there that work with 64 bits? So I can use it along IdHTPP.

Edit: I found SpiderMonkey for Delphi. It supports 64 bit but there is no 64 bit dll provided. "js64.dll" that is.

http://code.google.com/p/delphi-javascript/

Here is the 64 bit build. It works perfect with delphi-javascript

http://depositfiles.com/files/tfryg81ny

  • http://code.google.com/p/delphichromiumembedded/ ? – GolezTrol Nov 08 '12 at 21:08
  • 1
    It doesn't provide js64.dll, but it doesn't provide js32.dll, either. I think you're supposed to get that from Mozilla (or compile it yourself from Mozilla's code). – Rob Kennedy Nov 08 '12 at 22:25
  • 2
    It depends on what you are trying to achieve, but I found this recently and from what I have done with it so far it works great. Since Active Script is COM based I guess it doesn't matter about the 32/64 bit issue. I am only on D2010 and don't have 64-bit though. http://delphihaven.wordpress.com/generic-idispatch-proxies-for-active-scripting/ – Jenakai Nov 08 '12 at 22:58
  • @RobKennedy It does provide js32.dll http://code.google.com/p/delphi-javascript/source/browse/#svn%2Ftrunk%2Fdemo Thats to bad that support is for 64 bit but no 64 bit dll.. –  Nov 08 '12 at 23:23
  • @RobKennedy Yep it must be compiled probably. Would be too hard i think. –  Nov 08 '12 at 23:27
  • The combination of requiring both >4GB and JavaScript makes me cringe. – Wouter van Nifterick Nov 08 '12 at 23:43
  • @WoutervanNifterick 64 bit is the future. –  Nov 08 '12 at 23:57
  • @RichardO'Reilly: 32bits applications (Delphi, Visual Studio, Chrome, etc) are not about to disappear any time soon. In general I'd say that if your application requires more than 2GB of RAM per instance it's a red flag that you're probably doing something wrong. There are exceptions of course, but at this point in time, they are rare. – Wouter van Nifterick Nov 09 '12 at 00:25
  • @WoutervanNifterick I am devloping a data mining application :) –  Nov 09 '12 at 00:27
  • How about this one: http://code.google.com/p/besen/ – Ville Krumlinde Nov 09 '12 at 08:02

4 Answers4

10

You can try also BESEN which is a ECMAScript/JavaScript Engine written in ObjectPascal itself, without any external DLL libraries.

BeRo
  • 149
  • 3
  • 3
    Late reaction, but BESEN is an amazing piece of code. I'm even more amazed that one single person has been able to make something of this complexity work at all. Respect! – Wouter van Nifterick Mar 24 '15 at 23:37
3

How about TWebBrowser?

Create 64bits Delphi application, drop a TWebBrowser on your form, and run this:

WebBrowser1.OleObject.Document.ParentWindow.execScript('alert("Hello")');

Voila, no extra components needed.


In Action

Wouter van Nifterick
  • 23,603
  • 7
  • 78
  • 122
  • Yes i was thinking of using this and outputing the results to a 64 bit MySQL so i am not limited by memory there. –  Nov 09 '12 at 09:57
  • 1
    By the way, run this to see that it's actually the 64bits engine: `WebBrowser1.OleObject.Document.ParentWindow.execScript('alert(navigator.userAgent)');`. When you compile to 32bits, this won't show the x64 part. – Wouter van Nifterick Nov 09 '12 at 10:06
  • Problem with IE is its a wrapper. It can't be threaded well very hard. Chrome Embedded would be better to use.. –  Nov 09 '12 at 10:18
  • @RichardO'Reilly: yeah that might be better, but it doesn't exist today. Read this: http://www.chromium.org/developers/design-documents/64-bit-support – Wouter van Nifterick Nov 09 '12 at 12:25
  • So it can be compiled as 64 bit :) ? –  Nov 09 '12 at 12:27
  • Yes, but not for windows. I sure hope you're not planning to do your >4GB multi-threaded datamining app with JavaScript and Delphi for MacOSX! – Wouter van Nifterick Nov 09 '12 at 12:46
  • With all due respect, Besen should be the correct answere here if you are looking for a Delphi native version, followed by V8 and Spidermonkey. TWebbrowser can hardly be called a browser, it breaks every standard in the book on a whim; Let alone a "javascript engine" as the question entails. Besen is a Javascript engine. V8 is a Javascript engine - spidermonkey is a Javascript engine. This is like asking "what is a car" and being shown a moped. Not the same thing. – Jon Lennart Aasenden Apr 02 '17 at 10:14
  • @jonlennartaasenden: Besen is a super cool project, but to somebody who doesn't even know how to call JavaScript from a Delphi application it's probably not really the best advice to use Besen. Last time I've tried it, I couldn't get any framework to work with it. If you have problems with the modern Internet Explorer for not complying to standards, I wonder why you suggest Besen. If you know what you're doing: try Besen to get a full Delphi solution; otherwise, better stick to a more standard solution, I'd advise. – Wouter van Nifterick Apr 09 '17 at 11:01
3

The mORMot ORM framework has a JavaScript Engine based on SpiderMonkey 45, which means it supports ES2015.

BTW, it also has a Node.js-compatible server-side JS implementation, very cool.


Apr 7, 2017 update: Now the SyNode JS engine included in mORMot is based on SpiderMonkey 52. github commit is here.

Edwin Yip
  • 4,089
  • 4
  • 40
  • 86
0

There is new Delphi wrapper for Google's V8 JS engine, available since Jun 1, 2016, called v8delphiwrapper

See some example code I demonstrated here.

Great thanks to it's developer @zolagiggszhou!

Edwin Yip
  • 4,089
  • 4
  • 40
  • 86