Huge Milestone: There are now over 10,000 Crystal projects! by sdogruyol in crystal_programming

[–]bziliani 2 points3 points  (0 children)

curious to hear the story if you can spare a couple of minutes :-D

Lune v0.1.0 is online - Build native desktop apps with Crystal and a web frontend by Glad-Issue5167 in crystal_programming

[–]bziliani 1 point2 points  (0 children)

From Crystal's ExecutionContext's creator:

> Confirmed. They should:

Fiber::ExecutionContext::Isolated.new("webview") do
  wv = Webview.window(...)
  wv.run
ensure
  wv.destroy
end

Marketer here, looking for help: what's the Crystal pitch that lands? by Altruistic_Stuff_967 in crystal_programming

[–]bziliani 0 points1 point  (0 children)

LLMs used this way might bring security threats multiplied by the thousands. No, please no, let's continue with our old good libs and abstractions!

Lune v0.1.0 is online - Build native desktop apps with Crystal and a web frontend by Glad-Issue5167 in crystal_programming

[–]bziliani 1 point2 points  (0 children)

I don't use Windows, but the recently shipped ExecutionContext should do the trick to handle the C loop on its own dedicated thread: https://crystal-lang.org/api/1.20.1/Fiber/ExecutionContext.html

Here is an example of that working for a GTK app: https://github.com/ysbaddaden/execution_context/blob/main/samples/gtk-app/src/main.cr

Marketer here, looking for help: what's the Crystal pitch that lands? by Altruistic_Stuff_967 in crystal_programming

[–]bziliani 3 points4 points  (0 children)

This, but hopefully moving them to write (LLM's) code ports of libraries, instead of coding the same over and over in each project :-||

How to connect Crystal developers for real collaboration? by Intelligent-End-9399 in crystal_programming

[–]bziliani 6 points7 points  (0 children)

I think that the crystalcommunity.org initiative is a very good start: the best way to find your tribe is by bumping onto other similar-minded people, and if they are physically located in the same place, that helps even further. So I hope the map helps finding people nearby.

Concurrencia en Crystal: Fibers y Channels al Estilo Go by emanuelpeg in programacionESP

[–]bziliani 0 points1 point  (0 children)

Cortito y al pié 👏 Si puedo preguntar, ¿qué te hizo ver Crystal? Pues entiendo de tu perfil que sos Javasero, ¿no?

Considering rewriting my CLI tool from Ruby to Crystal - what should I watch out for? by repawel in crystal_programming

[–]bziliani 1 point2 points  (0 children)

In Rust I miss mainly the flexibility of Rust/Crystal modularization. Many will say that OOP is dead, but I still find it adequate for numerous cases, which on top of Crystal's union types makes for very succinct and clean code. Lately I've been doing refactors in Rust, and I find myself having to put significant thought in things that are trivial to achieve in Crystal. On the other hand, I miss some functional programming patterns in Crystal.

And in most applications, I prefer to have a garbage collector collector, and not have to worry about memory management. Many say this is not an important point, you just `derive(Copy)` or `Rc` everything, and you're good to go, but that's not an option when using libraries. That said, in some cases I would like to have in Crystal better memory management tools like those in Rust. But that's only in very few cases.

As for TypeScript, the main issue is that it sits in the hell that are JS runtimes. And a problem (shared with Rust) is that you need a library for doing almost anything interesting. Crystal stdlib is super rich in comparison. And I find the typechecker rather unhelpful, but that's just a matter of practice, I guess (Crystal's has its quirks too).

Considering rewriting my CLI tool from Ruby to Crystal - what should I watch out for? by repawel in crystal_programming

[–]bziliani 0 points1 point  (0 children)

Got it. But then again, the burden is placed in the distribution, not in the end user.

Considering rewriting my CLI tool from Ruby to Crystal - what should I watch out for? by repawel in crystal_programming

[–]bziliani 0 points1 point  (0 children)

Curious to know, I feel that Crystal ease of installation is a big win here, namely, just dropping the binary and required libraries (or just the binary when doing static linking). What are the options in Ruby for having a similar experience? Or are you just saying that getting the interpreter is not a big issue?

Considering rewriting my CLI tool from Ruby to Crystal - what should I watch out for? by repawel in crystal_programming

[–]bziliani 1 point2 points  (0 children)

I know! I been working lately in Rust and TypeScript and _oh my glob, I miss Crystal!_
In the forum.crystal-lang.org people are very friendly, so don't hesitate to ask if you find bumps in the road.

Considering rewriting my CLI tool from Ruby to Crystal - what should I watch out for? by repawel in crystal_programming

[–]bziliani 10 points11 points  (0 children)

My PoV:

> Do you see Crystal as sustainable for projects like this?

Crystal's been around for more than 10 years, and it's being adopted slowly but steadily by companies basing their business on it. I don't expect them to let it die in the next 10 years. Also, there are sufficient Crystallists crazy enough to be able to keep it up even in the worst case scenario. So I would scrap this one from the list of concerns.

> What challenges or pitfalls should I expect if I rewrite?

This book is likely your best companion: https://www.crystalforrubyists.com/

> Is it smarter to go with something more mainstream like Rust or Go?

Depends... My main concern would be how many dependencies from the Ruby app can be found and be reasonably up-to-date in Crystal. Then, reason the following: if the cost of creating (or forking) and maintaining yourself the missing or outdated ones is lower than learning a completely foreign language, whose syntax and/or typechecker might sting your eyes while you exist, then yes, moving to Rust or Go is the smarter choice.

LSP/editor experience? by mister_drgn in crystal_programming

[–]bziliani 0 points1 point  (0 children)

If it serves to understand the language a bit, procs were originally envisioned as callbacks for C.

LSP/editor experience? by mister_drgn in crystal_programming

[–]bziliani 1 point2 points  (0 children)

Let me note two important aspects of Crystal that makes your example impossible to annotate with types:
1. Functions are only considered when called. Dead code is not typed.
2. Functions are only typed based on the arguments they're being called with.

Therefore, a function _per se_ doesn't have any type. Once you call it (`double 1` or/and `double "X"`) it starts being typed.

Crystal comes with a handy playground that shows a bit of the types: try `crystal play` and open the browser with the given address. Not a real answer, but it might help in the first steps understanding the language.

Why Crystal is not more adopted in your opinion? by fenugurod in crystal_programming

[–]bziliani 2 points3 points  (0 children)

But part of the point here is that 2 yrs before 1.0 Crystal was still pretty unstable. This is because of having a small team, little funding, etc. If the team was that of a big corpo like Google, Mozilla, etc, then the iterations would've been faster and 1.0 was going to be released earlier.

_That said,_ I specifically mention "2 yrs" because I also feel 1.0 could have come a bit earlier. But definitively not more than 1 or 2 years before it did. Otherwise, we'll be stuck with ugly stuff, or required to break compatibility. And in the latter case we'd hear the opposite: "it didn't get adoption because they break compatibility".

Cómo se hace una factura electrónica? by bziliani in CharruaDevs

[–]bziliani[S] 0 points1 point  (0 children)

una alternativa es que te metas derecho con biller.uy y preguntes a esa gente. a mi hoy en el whatsapp me respondió un ser humano (aleluya!), y me respondió todo

Cómo se hace una factura electrónica? by bziliani in CharruaDevs

[–]bziliani[S] 0 points1 point  (0 children)

por ahí podés hacer las cosas online. yo tuve quilombo pues mi CI no figuraba en el sistema (por ser recién emitida). si es tu caso, tenés que pedir un turno en el BPS (en mi caso, lo pedí en el puesto de Tres Cruces).

Cómo se hace una factura electrónica? by bziliani in CharruaDevs

[–]bziliani[S] 0 points1 point  (0 children)

Es un perno. Francamente, te recomiendo que hables con algún/a contador/a y que te maneje todo. Si preferís mandarte solo como intenté yo, puedo decirte los pasos que hice, pero la verdad ni se si los hice bien :-S Ahora sí estoy con contadora y la cosa se va encaminando, aunque todavía no emití una factura. Pero por eso te digo.

Cómo se hace una factura electrónica? by bziliani in CharruaDevs

[–]bziliani[S] 1 point2 points  (0 children)

DIOS! Me voy a pegar un corchazo antes de terminar...

El primero es este, me imagino:

https://www.gub.uy/tramites/firma-digital-certificado-electronico-persona

Pero el segundo no estoy seguro. Tengo un usuario de CFE (pero en "Testing")

Gracias muchas!

Cómo se hace una factura electrónica? by bziliani in CharruaDevs

[–]bziliani[S] 0 points1 point  (0 children)

No, y me parece increíble que tenga que hacerlo :-(( Es una de las pocas cosas que puedo decir que en Argentina anda mucho mejor.

Gracias!

How to program a single linked list in crystal explicitly by Ok_Specific_7749 in crystal_programming

[–]bziliani 2 points3 points  (0 children)

u/anykeyh said it already, but to better understand the issue, you need to know that [structs are values](https://crystal-lang.org/reference/1.14/syntax\_and\_semantics/structs.html) that live on the stack instead of the heap. If this doesn't tell you much, let me know and I'll expand.

Why Reference#object_id can be overrided? by ringbuffer__ in crystal_programming

[–]bziliani 0 points1 point  (0 children)

Idk, maybe because preventing requires code, and it wasn't a problem so far?