lukas
lukas
MModular
Created by lukas on 9/14/2024 in #community-showcase
WGPU-Mojo
I’m using my tree sitter grammar. I have my own extension which I’m using, but someone else made one as well I think
8 replies
MModular
Created by lukas on 9/14/2024 in #community-showcase
WGPU-Mojo
Yeah lol
8 replies
MModular
Created by Krisztian Szucs on 7/19/2024 in #community-showcase
Firebolt: In-progress implementation of Apache Arrow in Mojo
You don’t use UnsafePointer, just pass the function in directly and if the ABI matches then it works
25 replies
MModular
Created by Krisztian Szucs on 7/19/2024 in #community-showcase
Firebolt: In-progress implementation of Apache Arrow in Mojo
Hey, I was looking at the codebase yesterday and noticed a comment about Mojo not being able to use functions in CFFI. You can pass mojo functions right to cffi callbacks, you just can’t pass null pointers
25 replies
MModular
Created by lukas on 5/11/2024 in #community-showcase
tree-sitter-mojo
Ah I hadn't considered publishing the python bindings. Is there a specific use case you have in mind that the bindings would be able to accomplish?
58 replies
MModular
Created by lukas on 5/11/2024 in #community-showcase
tree-sitter-mojo
That’s an interesting question. Maybe when magic gets a little better I’ll write a Mojo wrapper around the C and publish
58 replies
MModular
Created by lukas on 5/11/2024 in #community-showcase
tree-sitter-mojo
It's mostly all working, aside from a few corner cases in the tree sitter grammar
58 replies
MModular
Created by lukas on 5/11/2024 in #community-showcase
tree-sitter-mojo
Ah I haven't put it up yet since I'm still tweaking a lot, but I can publish it with a YMMV warning I guess
58 replies
MModular
Created by lukas on 5/11/2024 in #community-showcase
tree-sitter-mojo
It should just be the same as how I added struct. Pr for that is welcome. I also should add tests
58 replies
MModular
Created by lukas on 5/11/2024 in #community-showcase
tree-sitter-mojo
I’m probably gonna start on __mlir_op sometimes this weekend or next week. It’s tricky to get right since it requires custom grammar parsing and not just a highlight token. At least that’s what it requires if we want more granular control over things like bracket vs plain backtick
58 replies
MModular
Created by lukas on 5/11/2024 in #community-showcase
tree-sitter-mojo
Yep, that’s what I’m doing (except I’m using Zed in the above which might have slightly different tree sitter setup)
58 replies
MModular
Created by lukas on 5/11/2024 in #community-showcase
tree-sitter-mojo
I haven’t pushed it yet
58 replies
MModular
Created by lukas on 5/11/2024 in #community-showcase
tree-sitter-mojo
I’m not sure how I want to highlight dialect names though. Or builtins
58 replies
MModular
Created by lukas on 5/11/2024 in #community-showcase
tree-sitter-mojo
No description
58 replies
MModular
Created by lukas on 5/11/2024 in #community-showcase
tree-sitter-mojo
We’ll probably have to patch in some of the newer syntax/tree sitter stuff. Lately I’ve been playing with special highlighting for MLIR stuff
58 replies
MModular
Created by lukas on 5/11/2024 in #community-showcase
tree-sitter-mojo
Ooh wait, is there a tree sitter grammar for MLIR? We could have it so that things like:
__mlir_op.`1: i1`
__mlir_op.`1: i1`
uses MLIR syntax highlighting injection within the backticks
58 replies
MModular
Created by lukas on 5/11/2024 in #community-showcase
tree-sitter-mojo
I’ll try to publish the zed extension later today
58 replies
MModular
Created by lukas on 5/11/2024 in #community-showcase
tree-sitter-mojo
Just pushed better support for parameter functions and decorators. Also wrote a Zed extension
58 replies
MModular
Created by lukas on 5/11/2024 in #community-showcase
tree-sitter-mojo
FWIW this is my helix config and it works for me
[language-server.mojo-lsp]
command = "mojo-lsp-server"
config = { provideFormatter = true }

[[grammar]]
name = "mojo"
source = { git = "https://github.com/lsh/tree-sitter-mojo", rev = "e645ad097257a29bed5ee6213fef47e26b280f63" }

[[language]]
name = "mojo"
grammar = "mojo"
scope = "source.mojo"
roots = ["__init__.mojo"]
file-types = ["mojo", "🔥"]
indent = { tab-width = 4, unit = " " }
auto-format = true
language-servers = ["mojo-lsp"]
formatter = { command = "mojo", args = ["format", "-q", "-"]}
[language-server.mojo-lsp]
command = "mojo-lsp-server"
config = { provideFormatter = true }

[[grammar]]
name = "mojo"
source = { git = "https://github.com/lsh/tree-sitter-mojo", rev = "e645ad097257a29bed5ee6213fef47e26b280f63" }

[[language]]
name = "mojo"
grammar = "mojo"
scope = "source.mojo"
roots = ["__init__.mojo"]
file-types = ["mojo", "🔥"]
indent = { tab-width = 4, unit = " " }
auto-format = true
language-servers = ["mojo-lsp"]
formatter = { command = "mojo", args = ["format", "-q", "-"]}
58 replies
MModular
Created by lukas on 5/11/2024 in #community-showcase
tree-sitter-mojo
Whoops I forgot to add alias, should do that now
58 replies