4 ms·
TickScript is indeed the killer feature, the problem is debugging is difficult because of the language itself is esoteric. Simply adding the ability to put prin
by exabrial 8y ago
TickScript is indeed the killer feature, the problem is debugging is difficult because of the language itself is esoteric. Simply adding the ability to put printf statements to the console would be a game changer. The ability to write tests outside of chronograf would be a game changer. The ability to mock inputs would be a game changer. The problem is you've re-implemented the wheel and now you have to build the debugging ecosystem that is a well beaten path for other languages. Love your guy's product. It's also hard to give you guys money, because there's no offering you make that quite fits one of our needs.
- pauldix 8y agoThanks for the TICKscript feedback. That’s all stuff that we want to have addressed in Flux. This alpha release doesn’t have that yet but printf, a test runner built into the influx CLI, and test inputs and outputs are all on the near term roadmap
- alexk 8y agoThat's my feedback on TICK as well, it's pretty hard to debug and implement something like this: https://github.com/gravitational/monitoring-app/blob/master/resources/alerts.yaml#L116 https://github.com/gravitational/monitoring-app/blob/master/... I looked at flux, and it seems pretty compatible with TICK script, although I don't have a clear understanding on how to make it easy to write alerts/queries and debug them yet. I would be curious to try out REPL: > We plan to provide a flux command line program that exposes a REPL and talks to various data sources. Especially interested to see how easy it would be to edit and troubleshoot a multi-line transformation query like this one in it: cpu = data // only get the last 5m of data |> range(start: -5m) // only get the "usage_user" data from the _measurement "cpu" |> filter(fn: (r) => r._measurement == "cpu" and r._field == "usage_user") Why create a new language vs using javascript or lua? e.g. your flux example above could have been just: let cpu = data.range({start: "-5m"}).filter(func(r){return r.measurement == "cpu" && r.field == "usage_user"}) Is there any specific feature of flux that requires a new language? I read your blog post here: https://www.influxdata.com/blog/why-were-building-flux-a-new-data-scripting-and-query-language/ https://www.influxdata.com/blog/why-were-building-flux-a-new... and it brings some valid points on Flux vs SQL, however I would be interested how would it compare as Flux vs Javascript or Flux vs Lua :)
- exabrial 8y agoThey're probably looking at Flux as a sunk cost now, but I agree, Lua would have probably fit the bill. Either way, I'm hoping this is "The Release" where things go consistent. They've pivoted several times, and it's all been good, but we do need a couple of years of consistency before we can make long term investments into Flux.
- pauldix 8y agoLua was certainly an option and it's one I was even considering as an embedded scripting language back in the fall of 2014. I gave a talk in London where I asked for a show of hands about Lua vs. Javascript as the choice and the majority raised for JS. One of the reasons we didn't go with that is because we didn't want a separate query vs. scripting experience like you have with SQL engines that embed programming languages. We wanted something that felt and looked seamless.
- exabrial 8y agoAwesome, great explanation, thank you. I disagree on your point about Lua, but given what you guys have built so far I have no doubt you'll be successful.
- pauldix 8y agoThere isn't a specific feature of Flux that requires a new language, although part of the language is a query planner and optimizer that is tied to certain functions in it. Technically any Turing complete language is equivalent, but in practice that is seldom true. Performance is one vector, but so is expressiveness, aesthetics, ease of use, etc. We chose not to use Lua because it's not a widely known language. Instead, we chose to create a language that looks and feels much like Javascript, which I think is the most widely used language today. However, we wanted to limit the scope of it and to add new syntax over time to make frequent tasks easier to express. Any time you create a new API or library, you create new surface area for a developer to know. A language is no different than this. Some languages are also much easier to learn than others. For example, I found Go a language that I could pick up the basics in very quickly, while Rust is something that I'm still learning over months of effort. I like both languages, but their learning curves are very different. I think Flux is quite easy to pick up for many programmers, although I'll have to see questions and have countless interactions with people trying to learn it to prove that out and make adaptations over time. Finally, one goal with including the UI in InfluxDB 2.0 is that as we improve it, most users won't have to learn Flux at all. They'll be able to accomplish what hey want by just clicking around the interface. We're not there yet, but it's what we aspire to. And we want to have control over the language to build it in conjunction with UI tooling to automatically manipulate it.