Stream: beginners

Topic: data structures


view this post on Zulip Joseph Anthony Zullo (Oct 23 2021 at 19:30):

Hello! To warm myself up with the language, I decided to implement a red-black tree. I know it's already done in a benchmark but it's kind of my go-to thing with functional languages, and it's fun to do. Here's a paste: https://gist.github.com/jazullo/ad54284a8188caed47a785a1951fb59e. Beware though it's still untested, and exposing the delete function crashes the compiler.

I was wondering if there was any syntax highlighting / editor support for Roc with common editors (e.g. VSCode). I realize it's early stages still but it would help a lot with making larger programs.

Also, I was wondering if there were any plans towards adding any higher levels of abstractions. This could really be it's own topic but something along the lines of traits / ml functors / interfaces could go a long way towards creating more modular code. I want to keep going with the data structures and implement all of the common ones, but having a proper system for handling stuff like comparables or enumerables would make things a lot nicer and faster than trying to simulate these things with records. I understand the desire to keep things simple and Elm-like but I think for Roc to be general purpose it should at least have ad-hoc polymorphism at the level of what Python does.

Thank you all for your time, help, and consideration.

view this post on Zulip Oliver Schöning (Oct 23 2021 at 19:33):

I saw a talk on Roc and Zig and the speaker was using coffescript in vscode. So for now that is what I am using so I don’t look at plain text files

view this post on Zulip Joseph Anthony Zullo (Oct 23 2021 at 19:35):

I saw that too but didn't realize it was coffee script syntax highlighting. Thank you, I'll try that out!

view this post on Zulip Lucas Rosa (Oct 23 2021 at 20:38):

if you are talking about the zig showtime talk then that was probably me :p

view this post on Zulip Lucas Rosa (Oct 23 2021 at 20:38):

I use coffeescript in VSCode for roc highlighting. But I got the idea from Richard

view this post on Zulip Lucas Rosa (Oct 23 2021 at 20:42):

He does the same with VIM I think. In regards to a VSCode extension, I think we’ve avoided it as to not encourage the use of other editors once the roc editor is more ready as a daily driver. Of course that’ll take some time, so someone probably will make one eventually and that’s ok. But I think the idea is to try to build the community around a unified editing experience, so all efforts are in that direction at the moment

view this post on Zulip Richard Feldman (Oct 23 2021 at 21:07):

something along the lines of traits

I'm working on a design proposal along those lines, will share when it's ready!

view this post on Zulip Richard Feldman (Oct 23 2021 at 21:09):

I was wondering if there was any syntax highlighting / editor support for Roc with common editors (e.g. VSCode). I realize it's early stages still but it would help a lot with making larger programs.

my hope is that by the time anyone is working on larger programs, we'll have the Roc editor useful enough to be a daily driver :smiley:

view this post on Zulip Richard Feldman (Oct 23 2021 at 21:11):

there's an unusual dynamic where in order for the Roc editor to realize its potential in terms of an ecosystem of plugins, lots of people have to be using it (so that it becomes normal to write package-specific plugins for it)...and the more early support for other editors there is, the harder it will be to jump-start that virtuous cycle for the Roc editor

view this post on Zulip Richard Feldman (Oct 23 2021 at 21:11):

so personally I'm actively planning not to work on support for any other editors, to give the Roc editor the best possible shot at realizing its potential!

view this post on Zulip Lucas Rosa (Oct 23 2021 at 21:37):

Ooo I didn’t know about a trait like proposal. Exciting 😈

view this post on Zulip Richard Feldman (Oct 27 2021 at 14:47):

@Joseph Anthony Zullo the design idea I was talking about re: traits is now in #ideas > Abilities!


Last updated: Jul 06 2025 at 12:14 UTC