top | item 37366099

Focus: A simple and fast text editor written in Jai

85 points| doesntmeananyth | 2 years ago |github.com | reply

101 comments

order
[+] binary132|2 years ago|reply
It’s silly that these threads instantly devolve into weirdly personal socio-ideological debates about the merits of the designer, his personality, the community, and his unorthodox approach to the language rather than even a technical discussion. It seems like cloutchasing all the way down.

I also recognize that I am participating in said dynamic.

[+] VHRanger|2 years ago|reply
For what it's worth, there's no product yet with Jai so that's all there is to talk about.
[+] anonymoushn|2 years ago|reply
What sort of technical discussion can we have if we cannot evaluate the software?
[+] mariusor|2 years ago|reply
I think that the only purely technical level complaint I have about the language, something that I haven't seen discussed in the docs but bit me because it worked differently than I expected is that return types are not part of a function's typing. Ie, when doing function polymorphism, functions "a :: (b: s32) -> bool" (a function called "a" that accepts a signed 4byte int and returns a boolean) and "a :: (b: s32) -> s32" (a function called "a" that accepts a signed 4byte int and returns a signed 4byte int) trigger a compilation error when you call one of them even if the type of the lvalue is known (either bool or s32).
[+] MattRix|2 years ago|reply
How is criticizing the creator of a project a form of clout chasing? It seems important to know the philosophy of the creator of a project, especially when that project is not yet finished.
[+] ReleaseCandidat|2 years ago|reply
This is meant as more of a general comment than to critisize this editor: I fail to see the selling point of an editor that "can't do much", but is performant - there is an abundance of these already. If you made an editor that does "everything" and is "fast", I may be interested.

Regarding Jai: the idea about a "language for good programmers" is just about the worst thing ever to say about a language and it's community in my opinion (and I'm being paid as a C and C++ programmer for 20 years now, so I guess I'm at least not totally bad at it).

[+] Xeamek|2 years ago|reply
GO was named a language for bad (not experienced) programmers by its creator. I don't see why doing the reverse of that automatically egregious

I mean sure, people are in general hesitant when someone calls himself good, and for a decent reason.

But pushing it to extreme and defaulting to reverse JUST BECAUSE someone dared to call himself good is also a pretty childish reaction. At the end of the day it is a fact that there are differences in skill between programmers and different languages expect from you different levels of understanding. Pretending it's only valid to acknowledge these differences in others but not in oneself is irrational.

[+] dmarcos|2 years ago|reply
I always interpreted Jon Blow “good programmer” = “cares about the craft”. Someone that knows deeply the tech stack and understands the tradeoffs made for each decision as opposed to those that just follow fashions and dogmas without evaluation (Object oriented, garbage collection, web framework du jour…). That’s my interpretation after following Jon for a while. could be wrong.
[+] flohofwoe|2 years ago|reply
This looks at least untypical for a "small and fast" editor in that it is a UI application, not running in the terminal like vi or nano.
[+] konsuko|2 years ago|reply
Jai is an amazing language to work with, I highly recommend checking it out once it becomes publicly released. It's elegant, simple, performant, takes all the best parts of Zig minus the annoying parts (like errors on unused local variables) and adds a bunch of super useful game development libraries as well as a built-in string type (which I really missed in Zig).

Oh, and the compile times are just a joy, almost no other language even comes close to the speed of iteration that's possible with Jai, which is another great reason to use it for games and prototyping in general.

[+] flohofwoe|2 years ago|reply
If Jai can only be judged once it's public, Zig should only be judged once it hits 1.0 though. Personally I put a lot more trust into Zig than Jai.
[+] ReleaseCandidat|2 years ago|reply
I'd have preferred a `fun` (or `fn, if you insist on 2 characters) instead of the Haskell-esque double colon `::` in function definitions to make parsing them easier. And the semicolon after `case` is irritating for me too. But `foo := bar` for a type-less `foo: TYPE = bar` is too much parser-friendly syntax and inconsistent with using a double colon `::` for function types and struct definitions. And inconsistent with using just the colon in `foo: TYPE`.

How do nested for-loops work, if `it` names the current iterator?

     for particles {
        // Inside for loops the "it" object is the iterator for the current object.
        particle_left := view_left \* it.particle_size;
     }
[+] ngrilly|2 years ago|reply
What is annoying with errors in Zig?
[+] jhack|2 years ago|reply
Cool, an open source project in a language no one can use. Say what you will about V, at least it exists.
[+] christophilus|2 years ago|reply
You can use Jai. You just have to ask. It’s in closed beta, but afik “closed” pretty much means “open to anyone who wants to be a beta tester”.
[+] sneak|2 years ago|reply
Given that the compiler for this language is not publicly available, is this still open source, considering that you cannot easily modify and rebuild it to your liking, despite being GPL?
[+] luckystarr|2 years ago|reply
GPL (I'm not talking about AGPL) only forces you to publish the sources if the binary would be published. If you don't have the program you don't have a right to the source.
[+] AlectronikLabs|2 years ago|reply
Afaik is Jai still in private beta or something alike, just seen some sources like this and RayLib bindings but not the compiler itself.
[+] greatNespresso|2 years ago|reply
This is my first exposure to Jai code, did not know it was now available to play with! Congrats on building this! Really appreciate your comments in the source.
[+] flohofwoe|2 years ago|reply
Jai is still in "closed beta" as far as I'm aware.
[+] Rochus|2 years ago|reply
It's interesting to look at the source code. However, I have yet to find a clear unique selling point that justifies the development of a new language and infrastructure, or clearly shows me why I shouldn't just use D, for example. Any hints?
[+] vblanco|2 years ago|reply
Jai has a few unique features that are quite interesting. You can think of it as C with extremelly powerful metaprogramming, compile-time codegen and reflection, and strong template systems, plus a few extra niceties like native bump allocator support or things like easily creating custom iterators. There is nothing quite like it.
[+] flohofwoe|2 years ago|reply
Personal preferences should be enough to choose a different language or create a new language (e.g. it can be as simple as "I don't like D"), in the end that's how progress happens, individuals not being happy with the status quo, and building something they like. If others like that thing too, it might even become popular (and if this happens without a big company behind it then that thing might even be objectively good).

(I'm not a fan of Jai's closed development model though, but to each their own)

[+] wudangmonk|2 years ago|reply
I think there is a very clear open spot where Jai fits in otherwise why would google be doing the same thing with their carbon language. People want a better c++. It should compile fast, have all the low level stuff of C. Have Metaprogramming and introspection and including a decent library for basic stuff would be nice too.

What this really reads to me is why not just use Rust. Rust is useful for the things Rust was designed for. Some people love it and think its the greatest language out there and that's fine but a lot of people have used it and they either do not like it or they like it but they wouldn't want to use it for the type of work they like to do.

Having more languages and each influencing another is the only way we can get better and better languages.

[+] mariusor|2 years ago|reply
To answer specifically about D, I think Blow considered it and couldn't get past the garbage collection (this is mostly inferred). As a matter of fact I heard of Jai through a presentation of Walter Bright's, so I'm pretty sure was definitely some back and forth between the two.
[+] anta40|2 years ago|reply
https://github.com/focus-editor/focus/blob/main/compile.bat:

jai -quiet first.jai

So... where can I find the Jai compiler?

[+] ohgodplsno|2 years ago|reply
Either ask very politely for years, or be in denial like half the Jai community that writes Jai but is never able to compile it.

Yes, there is a whole Jai community wiki made from half cobbled together knowledge (https://github.com/Jai-Community/Jai-Community-Library/wiki), and a super secret discord made for the super elite, non-compiler-having plebs are banned.

[+] mproud|2 years ago|reply
> This editor is not designed for editing very large files.

Anyone have any GUI (non-CLI) recommendations for editing larger files, specifically text files 10 MB+?

[+] fceruti|2 years ago|reply
Never tried it, but I read somewhere that BBEdit handles super large files really well.
[+] wazzaps|2 years ago|reply
VSCode does pretty well, opened 1GB+ sized files in it before.
[+] WhereIsTheTruth|2 years ago|reply
No tabs? Weird

If these GUI editors can't offer better than VIM + tmux, then something is wrong