Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate sweet.js #11

Open
paddymul opened this issue Sep 13, 2014 · 3 comments
Open

Investigate sweet.js #11

paddymul opened this issue Sep 13, 2014 · 3 comments

Comments

@paddymul
Copy link

I'm sure that sweet.js can help this codebase. You can make it a compile time only dependency.

String concatentation to build up functions is very awkward.
With sweet.js you can have regular javascript looking code, and then macros which perform the string concatenation for you at runtime if you are worried about code size. You just shouldn't be dealing with all of these strings, it's incredibly error prone. I'm taking a shot at the conversion.

@hughsk
Copy link
Member

hughsk commented Sep 13, 2014

Maybe minstache would be a sufficient solution here?

@paddymul
Copy link
Author

Take a look at this bug/feature request I filed with sweet.js
sweet-js/sweet-core#387

I think as much as possible you want to avoid string concatenation. If you have to do it, write the string concatted functions in a systematic way. With a proper macro system (that also allows runtime code generation), you could use jslint to avoid more errors too.

How do you write code for ndarray.js? Are you thinking about what you want the expanded code to look like? Do you write the expanded code first and then write the generating code?

I really like the idea of ndarray.js There is some great work here.

@rreusser
Copy link
Member

rreusser commented Jan 7, 2016

Wait, sorry, I'm getting distracted on code generation for ndarray dependents, not just ndarray itself. Disregard the last comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants