Comments (5)
Thanks for the ticket. I'll take a look on Saturday, but this should be a quick fix.
from riml.
@luke-gru Can you clarify the approach you will be taking to fix this bug?
Would it be possible to implement some form of a DAG to let the compiler figure out the right order of the includes?
Currently the compiler checks for presence of classnames, so the order of the include is crucial, else you get ClassNotFound
errors. Not needing to worry about include order is handy.
I guess what I'm asking is for require to work more like import
. 😄
from riml.
Well, I already have the easy solution to this implemented in a branch, and it fixes this issue. It just keeps track of the filenames that were already included and only includes new filenames. The dependency resolver would be a bit more work, but it shouldn't be too bad. I'll experiment a bit with it and report back.
I think riml
also needs a way to either import classes or ignore undefined classes altogether, because if I'm making a library mylib
that has as a dependency some other library written in riml
, I should be able to use those classes in my library without having to compile or link with the other library during each compile of 'mylib'.
What are your thoughts on this?
from riml.
The simpler solution sounds good for now.
Regarding dependency between libraries, A solution I've seen work to an extent is separate definition files. Eg:- Typescript has a Type Definition File that can be used to define the interfaces of a 3rd party library, so that it is able to compile against that library correctly. If my project used say jQuery, without a definition file a method call like $.foo
would be fine, whereas with the definition file it would throw a compile time error, like foo not found on $
.
Having said that this isn't an ideal solution, definition files tend to go out of sync as new revisions of the target library are released.
from riml.
Hey @dsawardekar, yeah definition files are probably useful for statically typed languages that need to be compiled separately from the dependent libraries, but for Riml I think a good enough solution for now is to maybe have something like
riml_import g:ThirdPartyClass
to register the class with Riml, and then you can use it elsewhere without any errors.
Also, for the lazy, I'll offer a command-line option to turn off compile-time class checking, I think.
I'll open an issue for this, and gather thoughts there.
As for this ticket, I'm going to close it, as the fix for the original issue is in master. I'll add another ticket for the DAG class registration implementation.
from riml.
Related Issues (20)
- Cache riml_includes between compile_files HOT 11
- Syntax error with dot access of "append" property on argument HOT 2
- Functions starting with uppercase letter HOT 2
- Make 1.8.7 compatible HOT 1
- smarter `riml_include` re-orders inclusions based off dependency graph for classes HOT 10
- add `riml_import` for importing classes. Once imported, you can use them without 'undefined class' errors. HOT 2
- Cache SID result HOT 2
- Minimum and Recommended version of Vim for `riml` generated code HOT 4
- `for` statement in global scope pollutes global variables HOT 3
- Functions that handle range HOT 2
- Upgrading to riml 0.3.7 doesn't pickup some classes in path HOT 4
- class method name generation error HOT 6
- exception when calling method on a list item in one statement HOT 13
- bug in boolean assignment
- calling self method with splat args fails
- Calling super in a class without extending a parent class HOT 1
- Strings with interpolation don't work with escaped single quotes.
- The pyeval function is not treated as a system function
- Viml generated by Riml is incompatible with Vim p260 or higher HOT 3
- Variables inside function should compile to local to function scope
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 riml.