Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
mirashii
on Sept 26, 2024
|
parent
|
context
|
favorite
| on:
Rewriting Rust
Now you need a general purpose embedded language interpreter to express your filter lambda? I'm not sure you've really made anything simpler.
rowanG077
on Sept 26, 2024
[–]
I don't see why you want an embedded interpreter for this. Can you explain?
tempodox
on Sept 26, 2024
|
parent
[–]
If you give a lambda to cargo-watch instead of a regexp, it has to be evaluated. Hence interpreter.
rowanG077
on Sept 26, 2024
|
root
|
parent
[–]
Why would you evaluate it using an interpreter? Since you are using it in the context of a rust lambda you compile it. You just have a rust file that calls cargo-watch as a library. Crafting an interpreter seems like an incredibly bad idea.
mirashii
on Sept 26, 2024
|
root
|
parent
[–]
But now you have to know at compile time what you're watching, which is not what cargo-watch or any of the similar commands like entr do.
rowanG077
on Sept 26, 2024
|
root
|
parent
[–]
Considering you have a rust file and the dependency why wouldn't you compile it? It's not like rustc is not available when you are using cargo-watch.
tempodox
on Sept 27, 2024
|
root
|
parent
[–]
Anyway, doing all that just so you don't have to write a regexp has all the hallmarks of overkill. Keep it simple.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: