I would like to implement a simple abstract domain using functors provided by module Domain_builder (documented in section EVA->Domains), but I am not able to open the module. A simple ocaml file x.ml:
open Domain_builder
and command frama-c -load-script x.ml produce error Unbound module Domain_builder. I am, however, able to import other modules documented in this section (e.g. Cvalue).
It seems that module Domain_builder is not exported by EVA's .mli file (https://git.frama-c.com/pub/frama-c/-/blob/master/src/plugins/value/Eva.mli), but neither is Cvalue module.
Am I doing something wrong, or is Domain_builder module really missing in EVA's signature?
Sadly, you're right, Domain_builder cannot be used outside of Eva for now
(NB: if it was exported, you'd have to open Eva.Domain_builder in any case).
As for why Cvalue is available: for historical reasons, this module, together with all files within src/plugins/value_types are in fact considered as kernel modules.
Related
I read about the architecture of Gobject introspection.
On one side i have a .so dynamic library, on the other side i have a gir file (some sort of xml file) for javascript bindings, which leads to the compiled typelib file.
Most of my typelib files are in the directory /lib/x86_64-linux-gnu/girepository-1.0
for example WebKit2-4.0.typelib.
how do i know, that i have to use, (where are the definitions?)
const Webkit=imports.gi.WebKit2;
because i tried
const Webkit=imports.gi["WebKit2-4.0"]; or
const Webkit=imports.gi.WebKit;
if i use imports.gi , gjs searches for a typelib file. The directories where it searches, i can get with
Gir=imports.GIRepository; log (Gir.Repository.get_search_path());
for other ids then 'gi', imports[directory][...][filename], it searches in the directories defined in the array imports.searchPath for a Javascript file, right?
last problem - the references on gjs page: there are a lot of functions, which exists in the references, but then are not available. Are there any other good references outthere, with examples?
how do i know, that i have to use, (where are the definitions?)
Probably the easiest way to find a GIR import name you don't know is by browsing the API Documentation, such as for WebKit2. Of course, you'll have to have the appropriate packages installed for those libraries.
for other ids then 'gi', imports[directory][...][filename], it searches in the directories defined in the array imports.searchPath for a Javascript file, right?
Yes, the imports.searchPath array is for JavaScript sources. You can read about those imports in the GJS project documentation.
the references on gjs page: there are a lot of functions, which exists in the references, but then are not available. Are there any other good references outthere, with examples?
You'd have to be clearer about which GJS page you're looking at and which functions. Below are some links to documentation for GJS:
gjs.guide (Tutorials, topic-specific guides, tips and examples)
GJS Project Documentation (Documentation about GJS itself)
API Documentation (Documentation for introspected C libraries)
We also have Matrix channels for GJS where you can ask for help:
https://matrix.to/#/#javascript:gnome.org (JavaScript)
https://matrix.to/#/#extensions:gnome.org (GNOME Shell Extensions)
Hydra provides a way to dynamically create a hierarchical configuration by composition and override it through config files and the command line, leveraging OmegaConf. I look for a recommended way to document the parameters but I could not find (a documented) one. What are best practices for that? Coming from argparse, I like the way of documenting the parameter inline, i.e. close to the code.
Excellent question! The answer is: parameter-by-parameter documentation is not yet implemented (as of Hydra v1.1, OmegaConf v2.1).
The future plans are:
in OmegaConf, expose an API allowing users to attach documentation (and other metadata) to each field of a structured config. See this open OmegaConf issue.
Once the above is complete, implement a Hydra feature allowing a parameter-specific help messages to be printed based on the parameter's metadata. See this open Hydra issue.
For now, the best we can do is to customize the general application help message (i.e. the --help command line flag).
I would like my Hack code to be broken down to Abstract Syntax Tree. Please advise me on available tools/libraries/github repositories which will help me to parse Hack code into AST.
I have found "h2tp" (hack to php transpiler written by Facebook), however it doesn't parse the code into AST. I also tried this project which does what I want however it is not recognising many of the operators and requires a significant rework, which will quite a lot of time to do.
hhast (HHAST: Low-Level AST Library) lets you do that, you may invoke hh_parse like this : hh_parse --full-fidelity-json $file | jq
taken from (https://github.com/hhvm/hhast/blob/master/docs/ast-lib.md)
The HHVM itself provides a lot of tools to dump the structure of a PHP file. However, the AST dump was removed: https://github.com/facebook/hhvm/issues/1268
What you can do is dump the HHVM assembly language: http://hhvm.com/blog/6323/the-journey-of-a-thousand-bytecodes
HHVM also has a PHP transpiler which may help:https://docs.hhvm.com/hack/tools/transpiler
You could also try to port this extension over to the HHVM: https://github.com/nikic/php-ast
Firstly: The "official" (?) node.js externs are located here: https://github.com/google/closure-compiler/tree/master/contrib/nodejs
But i can't use it because the high amount of warnings (and errors sometimes) that are generated. For example: The declaration of "process" module is very "thin"; Only has one property defined on his prototype, besides not inherit from EventEmitter, so i can't register callback when, for example, i want to do a clean job on process SIGINT (process.on('SIGINT', callback)).
When i mix several externs files declaring the core modules of node.js, more and more warnings and errors are raised (i always respect the deps tree between externs). For example: If i include the events.js and stream.js externs files, an error is raised because the "event" global var is redeclared: Once in events and again in stream.
So: What am i doing wrong?
The closure compiler that i am using is the latest git, whit --new_type_inf and --env flags activated, among others.
For example: If i include the events.js and stream.js externs files, an error is raised because the "event" global var is redeclared: Once in events and again in stream.
This highlights the core of the problem - and why they are not well maintained. The compiler doesn't recognize that these variables are in fact NOT global. The compiler currently does not have a method to correctly interpret externs as modules. The were originally contributed and consumed by a fork of the project that could understand externs as modules.
I am currently working on adding support to the compiler for this and hope to some day soon be able to completely rewrite this answer.
In the mean time, you might be able to work around some of this by adding #suppress {duplicate} annotations to the files. However keep in mind that they will still be global types.
If you wish to improve the files (like having process properly extend EventEmitter), I will happily review pull requests for such changes.
Currently I am evaluating ioncube for products developed by our company.
When running the encoded product I'm getting
PHP Fatal error: Class '[obfuscated]'
If I have anything like DomDocument in my code I get this error. I feel like if I have any php package installed and used Ioncube throws a error. I contacted Ioncube support and I'm unable to get a solution.
Does anybody know how to use Ioncube with a code contain DomDocument, imagick like package usages?
Obfuscation renames latent symbolic information in the compiled code of ionCube files, using names that are nonsense, or in the case of functions, names that would not even be valid were they used in PHP source. The corollary of this is that any non-encoded context will fail that attempts to use a symbol that has been obfuscated, as expected.
To bridge between the encoded and non-encoded world, an obfuscation exclusion list can be specified to name the symbols that should not be obfuscated. Due to the nature of PHP, in code such as $a->foo(), it is in general unknown what class $a is an instance of, and therefore if excluding foo() from being obfuscated, foo() used in any class context (i.e. all foo()s) would need not to be obfuscated. This isn't really a problem as symbol renaming is much less important than new features such as code encryption with dynamic algorithmic keys, but it is still preferable not to blindly exclude from obfuscation every method that happens to share the same name as a method from a module, which is why methods of module classes are not excluded by default.
The upshot of this is that you should prepare an exclusion file of just the methods that you want to exclude. It would be useful to have pre-prepared lists of functions for all known modules, and this is likely to be available in a future release, but it is easy to produce this oneself either manually or automatically.
Disclosure: I am associated with ionCube.