dartdevc improving build speed with reuse of kernal/dill files - dart

I'm using the Dart Dev Compiler (ddc / dartdevc) to convert some Dart files to JavaScript. All is working as expected, however the build times are somewhat slow (3 seconds or so).
The CLI for DDC allows the passing of a "summary" file, which from research looks to be the kernal/.dill files for Dart. I'm not entirely sure what these are, but from looking around at implementations such as DartPad and the webdev package, providing this file seems to be the way forwards.
I can successfully provide my local copy of the ddc_sdk.dill file, and the build does compile file, however the speed is still slow. DDC also generates a .dill file for the generated JavaScript file, however I'm not entirely sure what it's for, or what the use of it is.
Providing the generated .dill file throws the error:
dartdevc -k arguments: -s /example/.dart_tool/js/test.dill --packages /example/.dart_tool/package_config.json -o js/test.js /example/test.dart
dart --version: 2.17.0-222.0.dev (dev) (Fri Mar 18 12:54:18 2022 -0700) on "macos_x64"
Crash when compiling org-dartlang-app:/js/test.dart,
at character offset null:
Null check operator used on a null value
#0 _buildInternal (package:front_end/src/kernel_generator_impl.dart:129:53)
Essentially I have a ./dart_tool/js/test.dart file, and I execute:
dartdevc
--summary
./dart_tool/js/test.dill
--packages
./dart_tool/package_config.json
--output
./dart_tool/js/test.js
./dart_tool/js/test.dart
Can anyone shed any light on how to speed up builds with DDC & reuse the .dill files?

Related

Intermediate Files formed during compilation of DART code

I want to see intermediate files which are formed during compilation for DART code, what command should I run in cmd?
Example: For hello.c file, I can run gcc -Wall --verbose --save-temps -o first-exec hello.c to see intermediate files which will be formed like hello.s, hello.s, hello.o.
I want to see similar assembly code files formed during DART compilation? Any command through which I can see it ?
I don't think the native Dart compiler creates any files. It's handled entirely in-memory. The web-compilers are different because they actually do create .js files.
The VM definitely do not create assembler files, its built-in assembler writes directly to memory. There is not a separate assembler, like cpp's as or gas, which is run on an intermediate result.
Even the AOT native compilation does not have that kind of intermediate step.
You can choose to compile to a jit-snapshot or kernel file using, e.g., dart compile kernel. That shows you the intermediate Dart format.

-catalog silently fails with Saxon, how to fix?

I'm running Saxon-HE 9.8.0.8J together with xml-resolver 1.2:
$ java -cp saxon.jar:resolver.jar \
net.sf.saxon.Transform \
-t \
-warnings:fatal \
-catalog:this-file-is-absent.xml \
-s:a.xml -xsl:a.xsl
I'm getting:
Checking XML and XSL files...
Loading catalog: file:/this-file-is-absent.xml
Saxon-HE 9.8.0.8J from Saxonica
Java version 1.8.0_40
...
Is this how it is supposed to work? Just silently continue if the file is not found? Am I doing something wrong?
I've stepped this through the Apache catalog resolver, and it emits a message "Catalog does not exist" at debug level 3, but the default debug level is 2, so the message disappears.
In fact it's Saxon that sets the level to 2 (when -t is set) so this is under our control. But it's not easy to find out what the appropriate settings are. Also, I'm very reluctant to modify the resolver's configuration because the Apache code puts configuration details in static variables, which means that any changes you make affect other unrelated parts of the application that happen to be running the same Java VM.
Of course if the failure to find the catalog results in failures to locate some source file, you'll get diagnostics for this.
There are many ways I would like to improve the Apache catalog resolver but I don't particularly want to fork it, because I imagine that testing it after changes is a major undertaking.

How to setup and use lua squish?

I know it can be a dumb question , but how i can setup and use squish to compile my lua scripts.
I'm tired searching google and i can't find anything to explain me how to use
Someone can point me on right direction
I use lua 5.1 on windows OS
Thank you
First download and unpack the archive containing Squish's code. Alternatively, you may clone the repository. The change into the directory containing the squish.lua file. You will also need a Lua 5.1 executable (which I'll assume is called lua51.exe in the commands below).
The Unix Makefile in the archive contains roughly the following commands (translated to Windows) to build the squish tool:
bootstrap squish tool (without gzip compression or debug support for now)
lua51.exe squish.lua -q --with-minify --with-uglify --with-compile --with-virtual-io
prepare gzip compression modules
lua51.exe squish -q gzip
prepare debug support
lua51.exe squish -q debug
build final tool (with gzip compression and debug support)
lua51.exe squish -q --with-minify --with-uglify --with-compile --with-virtual-io --with-gzip --with-debug
The result is a Lua script squish (without the .lua extension) in the current directory. To use it you have to write a squishy file for your project and execute a command line similar to the last one above in the directory containing your squishy file.

Any ZMQ bindings for Erlang on Windows?

Is it possible to use Erlang with ZMQ on Windows? I have tried to use erlzmq2, but rebar fails to compile it with cryptic linker errors. Of course i can invest some time and investigate makefiles, but maybe other way exists?
Update
Whose who are interested in compilation errors can download latest erlang for windows and try to build erlzmq2 (Visual Studio 2012 compiler, msys sh and make). Error looks like:
cl : Command line error D8021 : invalid numeric argument '/Wl,-DLL,-IMPLIB:.libs
\zmq.dll.lib'
Makefile:541: recipe for target 'libzmq.la' failed
make[3]: *** [libzmq.la] Error 2
Please note that other erlang libs are compiling with this setup without any problems.
Your problem lies in compiling ZeroMQ for Windows. You haven't actually gotten to any Erlang yet. Here are some of the clues that tell you this:
Makefile:541: recipe for target 'libzmq.la' failed
This line says there's a problem on line 541 of the Makefile. But in erlzmq2, you can see that neither the main Makefile nor the c_src Makefile (which is what would build libzmq.la) has anything close to that many lines.
make3: * [libzmq.la] Error 2
The [3] means that you're 3 invocations deep into Make. Specifically, you started at the top-level Makefile, which called Rebar, which ran make -C c_src, which downloads ZeroMQ version 3.2.2 and tries to do a ./configure && make
To fix this Unix-style, go into the deps directory of erlzmq2 and figure out how to correctly compile ZeroMQ. Hopefully, you will just need to pass some arguments to configure. Then you can edit c_src/Makefile and set ZMQ_FLAGS to whatever you had to do for configure, clean, and make.
To fix it more Windows-style, follow the Windows build instructions for ZeroMQ. Put the compiled libzmq under deps and just edit the c_src Makefile to a no-op.
Finally, if you don't actually need to run this code on Windows, but are just using Windows as your development environment, I think you'll have the easiest time by running the build inside a Linux VM (not a hard thing at all with tools like Vagrant). Sorry, but Unix is the real system for this stuff; Windows support is an afterthought.

Delphi 2009 command line compiler using dcc32.cfg?

In Delphi 2009, how can I build a project using command line. I tried using the command line compiler and supplying -a -u -i -r in dcc32.cfg file. But compiler is not recognizing the paths and throwing the error required package xyzPack is not found.
-aWinTypes=Windows;WinProcs=Windows;DbiProcs=BDE;DbiTypes=BDE;DbiErrs=BDE
-u"C:\MyProj\Output\DCP"
-i"C:\MyProj\Output\DCP"
-r"C:\MyProj\Output\DCP"
and on command line i execute the command :
dcc32 "C:\MyProj\MyProject.dpr" -B -E"c:\MyProj\Output\EXE"
What am I doing wrong here?
Thanks & Regards,
Pavan.
Instead of invoking the compiler directly, consider using MSBuild on your .dproj, since that's what the IDE uses. Delphi MSBuild Build Configurations From Command Line might help you with that.
From the related answer (as shown below) ie:
Compiling with Delphi 2009 from a command line under Windows Vista 64-bit
I notice that you should be able to build a single package from the command line this way. I have used batch files (buildall.cmd) to launch dcc32, and have not yet used msbuild.
I have ultimately found both approaches frustrating, and have instead decided to opt for building a little GUI shell (a lite version of Final Builder, if you like) that basically works as a semi-graphical semi-command-line way of automating my builds and filtering the compiler output to produce results. I would be highly interested in anyone else's experiences with "tinder box" (daily or even continuous build) operations with Delphi.
You may end up where I'm heading... just buy Final Builder. :-)

Resources