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

Lua scripting support and 'script newcolumn' command #136

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

Dimagog
Copy link
Contributor

@Dimagog Dimagog commented Aug 25, 2018

'xsv script newcolumn' command allows creation of new columns,
calculated by Lua script based on current and previous rows.

Many other commands can be added in the future
(map, filter and reduce come to mind first),
that's why there is an extra 'newcolumn' sub-command.

'xsv script newcolumn' command allows creation of new columns,
calculated by Lua script based on current and previous rows.

Many other commands can be added in the future
(map, filter and reduce come to mind first),
that�s why there is an extra 'newcolumn' sub-command.
@Dimagog
Copy link
Contributor Author

Dimagog commented Aug 25, 2018

I'm working on unit tests but decided to publish it early for code review.

@Dimagog
Copy link
Contributor Author

Dimagog commented Aug 25, 2018

Tests are done and I've merged with the latest master. Ready for review.

@Dimagog
Copy link
Contributor Author

Dimagog commented Aug 29, 2018

@BurntSushi do you have any comments/concerns for this change?

@BurntSushi
Copy link
Owner

@Dimagog I think this looks like a potentially neat change, but I'm not sure if it's a good fit. Practically speaking, adding a C dependency increases maintenance burden. I have very little time for this project as it is, and I really do not want to deal with a dependency on an entire programming language.

In general, I'm not sure if it's a good fit for xsv, which is focused on implementing common operations very quickly.

My suggestion is that if you want a CSV tool that permits arbitrary scripting, then it might be better to go and build that tool separate from xsv.

@Dimagog
Copy link
Contributor Author

Dimagog commented Aug 30, 2018

No problem, I’ll have to keep the fork then.
For my needs I had to use 3 separate tools at first, but wanted to converge on just one. So I’ve picked xsv (partially because I wanted to play with Rust :-) ) and added missing functionality. Now that it does what I need I have no plans to evolve it.

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

Successfully merging this pull request may close these issues.

2 participants