nelson-lang / nelson-minimalist-core Goto Github PK
View Code? Open in Web Editor NEWNelson's minimalist core
License: GNU Lesser General Public License v3.0
Nelson's minimalist core
License: GNU Lesser General Public License v3.0
Algo used does not use mapfile (using boost)
fileread is slower
Could be optimized :) later
Expected list (no new dependency required) modules:
need to check if it is possible
To be sure that each PR does not break something
cmake and windows installer embed too headers files.
embed only .h and .hpp used and required.
Will be fixed first in main repo.
As discussed a bit in this issue, and in order to implement a Jupyter kernel based on nelson
, having a feature where the given code is to be completed and the matches are returned would be great. This seems to exist in nelson
original version with the text_completion
module missing here.
Thanks a lot!
Nelson 0.7.9 has many new features about compatibility :p
overloading, anonymous functions, operators updates , speed optimization ...
Hi,
Thanks for this amazing project! We are considering packaging nelson for conda-forge, and I would like to know if the additional modules of Nelson (i.e. not in this core repo) can be packaged independently. My intuition is that it should be possible if installing a Nelson module consists in copying some files at the right place so that Nelson can find it, but I haven't diven into the details and I wanted to check there was no additional step required.
to check also static build
Hello,
Thanks for this great work! I want to use nelson-minimalist-core
as a package, and tried to install it but it seems that there are some missing files (some of them are available in the original nelson
(gpl-3.0.md
CHANGELOG-0.{1, 2, 3, 4, 5}.x.md
modules/{module_name}/etc
) and some aren't (modules/modules.m
)). I wanted to check if I missed something or if this is a mistake that needs fixing. I tried though to comment the corresponding lines in CMakeLists.txt
files and managed to get an install but I don' find any files to include in the ROOT_OUTPUT
apart from libs and executables...
Thanks!
I realized when using FileCompleter
and VariableCompleter
available in the text_completion
module that they are not considering if the retrieved files or variables start with the given prefix
to complete. I just wanted to check if this wasn't done on purpose, and in that case, open a PR to fix it.
Note that BuiltinCompleter
and MacroCompleter
do consider that.
CodeQL reports more warning than in main repo.
Need to check and fix in main repo and report in this repository.
in environment wasm, does it interesting/possible to have features as:
cd
, pwd
, mkdir
, ls
(using c++ standard library)
playing with jupyter lite, it seems to be supported with python kernel ('/drive')
Does it require somethings special ?
read/save files
it is already possible to read .m , so i suppose that it is possible ?
any limitation ?
is it possible to create tempory files in wasm too ?
(Thanks @JohanMabille)
Hi,
I can see in the CmakeLists.txt that it is not possible to build nelson with cmake on Windows. Are you open to remove this constraint? If it was introduced because of a technical issue that you don't have the time to deal with, I'm happy to help to fix it.
with #6 we could also use in CI
In the context of implementing a Jupyter kernel for Nelson (similar to this one for cling
https://github.com/jupyter-xeus/xeus-cling), I figured using EvaluateCommand
could be a good way to evaluate a given command. But then, I couldn't find the output of the evaluation. IIUC, an AbstractSyntaxTree
is used for command storing but I was wondering how to get the output of the command after being executed?
Thanks!
In order to integrate nelson
in the xeus-nelson
kernel and have a first version of it, we need to make nelson
available as a package on conda-forge (conda-forge/staged-recipes#21841).
This requires to build from a tarball, and therefore to have an existing tag on nelson-minimalist-core
, could be 0.1.0
. Are you okay with that?
Regarding the PR on conda-forge mentioned above, I was thinking of adding you as a maintainer of the recipe since you are the creator/owner of nelson, but no obligation of commitment of your own (more of a rights granting) :)
Can you confirm that this is alright?
I have started to look at the cmake packaging to make it easier for an external project to link with differnet parts of Nelson. I have some questions regarding which changes you would accept:
1] Install pattern
It is quite common on Linux and MacOS to install binaries directly under PREFIX/bin and PREFIX/lib, and to install public headers under PREFIX/include/PROJECT_NAME. The conda distribution provides a similar files tree on Windows, so that the install is quite similar on all the platforms. In the case of Nelson, adopting such a pattern means:
${CMAKE_INSTALL_PREFIX}
instead of ${CMAKE_INSTALL_PREFIX}Nelson-${Nelson_VERSION_MAJOR}.${Nelson_VERSION_MINOR}.${Nelson_VERSION_MAINTENANCE}
bin
is removed.Notice that these changes are independent.
2] CMake targets and exports
Exporting and installing the targets used to build the Nelson libraires would simplify a lot the link with them in downstream projects. One would simply write find_package(Nelson)
followed by target_link_libraries(myLib PRIVATE Nelson::interpreter)
for instance, and would get the include_directories and dependencies of Nelson::interpreter
for free.
This requires two kinds of changes:
nelsonTargets.cmake
file, that would embed all the targets, as long as NelsonConfig.cmake
and NelsonVersionConfig.cmake
.CMakeLists.txt
to use target properties instead of global propertiessteps:
micromamba env create -f environment-wasm-build.yml
with ubuntu 22.04
name: nelson-wasm-build
channels:
- conda-forge
dependencies:
# Build dependencies
- cmake
- cxx-compiler
- emsdk >=3.1.11
- empack >=2.0.1
# Host dependencies
- eigen
- pkg-config
micromamba activate nelson-wasm-build
emsdk install 3.1.20
emsdk activate 3.1.20
mkdir build
export EMPACK_PREFIX=$MAMBA_ROOT_PREFIX/envs/nelson-wasm-build
export PREFIX=$MAMBA_ROOT_PREFIX/envs/nelson-wasm-host
export CMAKE_PREFIX_PATH=$PREFIX
export CMAKE_SYSTEM_PREFIX_PATH=$PREFIX
emcmake cmake
-DCMAKE_BUILD_TYPE=Release
-DBUILD_SHARED_LIBS=OFF
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON
..
make -j5
Build fails tested v0.1.0, v0.2.0, master and more_things branches
wasm-ld: error: unknown argument: --sort-common
wasm-ld: error: unknown argument: --as-needed
wasm-ld: error: unknown argument: --disable-new-dtags
wasm-ld: warning: unknown -z value: relro
wasm-ld: warning: unknown -z value: now
em++: error: '/home/mcallan/micromamba/envs/nelson-wasm-build/lib/python3.11/site-packages/emsdk/upstream/bin/wasm-ld -o nelson-cli-exec.wasm -O2 --sort-common --as-needed -z relro -z now --disable-new-dtags --gc-sections -L/home/mcallan/micromamba/envs/nelson-wasm-build/lib CMakeFiles/nelson-cli-exec.dir/nelson_cli/main-cli.cpp.o ../engine/libnlsEngine.a ../terminal/libnlsTerminal.a ../core/libnlsCore.a ../memory_manager/libnlsMemory_manager.a ../localization/libnlsLocalization.a ../functions_manager/libnlsFunctions_manager_builtin.a ../files_folders_functions/libnlsFiles_folders_functions.a ../interpreter/libnlsInterpreter.a ../display_format/libnlsDisplay_format.a ../operators/libnlsOperators.a ../os_functions/libnlsOs_functions.a ../nelson_manager/libnlsNelson_manager.a ../profiler/libnlsProfiler.a ../stream_manager/libnlsStream_manager.a ../api_nelson/libnlsApi_nelson.a ../types/libnlsTypes.a ../error_manager/libnlsError_manager.a ../commons/libnlsCommons.a ../i18n/libnlsI18n.a ../characters_encoding/libnlsCharacters_encoding.a ../elementary_mathematics/libnlsElementary_mathematics.a -L/home/mcallan/micromamba/envs/nelson-wasm-build/lib/python3.11/site-packages/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten -lGL -lal -lhtml5 -lstubs -lnoexit -lc -ldlmalloc -lcompiler_rt -lc++-noexcept -lc++abi-noexcept -lsockets -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr --allow-undefined-file=/tmp/tmpq_9espcq.undefined --strip-debug --export-if-defined=main --export-if-defined=__start_em_asm --export-if-defined=__stop_em_asm --export-if-defined=__start_em_lib_deps --export-if-defined=__stop_em_lib_deps --export-if-defined=__start_em_js --export-if-defined=__stop_em_js --export-if-defined=__main_argc_argv --export=stackSave --export=stackRestore --export=stackAlloc --export=__errno_location --export=__get_temp_ret --export=__set_temp_ret --export=__wasm_call_ctors --export=__cxa_is_pointer_type --export=malloc --export=free --export=saveSetjmp --export=setThrew --export=__dl_seterr --export-table -z stack-size=65536 --initial-memory=16777216 --no-entry --max-memory=16777216 --global-base=1024' failed (returned 1)
make[2]: *** [modules/main/CMakeFiles/nelson-cli-exec.dir/build.make:121 : modules/main/nelson-cli-exec.js] Erreur 1
make[1]: *** [CMakeFiles/Makefile2:1342 : modules/main/CMakeFiles/nelson-cli-exec.dir/all] Erreur 2
What did I miss ?
When building nelson-minimalist-core
on emscripten-forge, duplicate symbols errors are got with AddGateway
, GetGatewayInfo
RemoveGateway
... due to duplication in modules display_format
, functions_manager
and trigonometric_functions
:
https://github.com/emscripten-forge/recipes/actions/runs/4204004679/jobs/7294100993
'addpath' allows to inspect a directory and parse .m files available in this directory.
Once files parsed , it is possible to call a script or function.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.