Comments (1)
Hi @tripleo1. There is already a working implementation of XL, that's -O0 as implemented in interpreter.cpp. It is working in the sense that passes the whole test suite. Now, of course, I want to add more things to it, but the key issue at the moment is that it's just way too slow for my Tao3D use case.
Regarding your video, I'm sorry, but I am strongly not convinced. They don't really explain how they measure the footprint of the various implementations. For lua, for example, they claim 310K. That is probably the footprint of the Lua library on x86 (to which you'd need to add ~50K for luac
). But for Lua, this is native, executable code. What makes me unconvinced is that they compare that native code footprint with 4K of obfuscated Javascript source code, which requires a whole Javascript VM to run, and that alone is more than the Lua VM. For example, on my machine, the node
binary alone is 36M, way above the ~400K of a full Lua implementation.
XL is written in C++, not C, and not really optimized for size at the moment. So a working implementation is more in the 2M range. Larger than Lua, smaller than JavaScript, and not optimized at all for the moment (4 implementations in one binary).
What is more interesting is the source code size. Lua is 22733 lines of C code (on 5.3.0). XL is 42013 lines of C++ code, but that includes four different implementations. The LLVM and bytecode implementations account for 14126 lines of code, so what is left is 27887 lines of code. I tend to comment a lot, 8745 of the 42013 lines are comments, and 5591 are blank lines. Lua has 771 comment lines and 3724 blank lines. So overall, source code complexity is on the same order of magnitude, and I hope to keep it that way ;-)
Using C++ will definitely cost me a lot in terms of binary size, but I expect that to go down when XL self-compiles. And when I get to a point where one implementation looks good enough, I will definitely start optimizing. We are not there yet, by far.
from xl.
Related Issues (20)
- Cleanup the runtime from old / obsolete functions
- Convert XL native modules to XL_NATIVE
- Implement modules
- Error evaluation rules
- Remove remnants of bytecode interpreter (or, alternatively, fix it) HOT 5
- Fast compiler similar to what was used in Tao3D HOT 1
- Improve llvm-crap to deal with deprecated functions in LLVM 9.0.1
- Chat room? HOT 1
- [Comment/Suggestion] The Definition Operator HOT 5
- Conceptual question: how is this language different than other prologs? HOT 1
- Imperative flavour: continue & break in loops HOT 4
- Add to https://github.com/kostya/benchmarks/
- NULL/nil/none/void/... value considered harmful (a "billion dollar mistake" of Tony Hoare) HOT 10
- Treat float literals as decimal float literals and not as binary float literals HOT 2
- Nubie feedback - can't build HOT 4
- Can't build native/HelloWorld HOT 3
- Basic Examples Compiler Explanation HOT 1
- Data Inheritance HOT 1
- Typo in opcodes.h HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xl.