From 05008b4e763bdda5c200e580bf334d8325e75042 Mon Sep 17 00:00:00 2001 From: Ismael Arenzana Date: Tue, 11 Jan 2022 16:26:05 -0500 Subject: [PATCH] About Rust --- .gitignore | 1 + content/posts/2013-05-22-esta-vivo.md | 4 +- .../2013-06-01-bittorrent-y-la-nueva-nube.md | 2 +- content/posts/2021-02-01-bye-whatsapp.org | 4 +- content/posts/2022-01-11-emacs-rust.org | 44 +++++++++++++++++++ 5 files changed, 50 insertions(+), 5 deletions(-) create mode 100644 content/posts/2022-01-11-emacs-rust.org diff --git a/.gitignore b/.gitignore index c11d1ac..0bb36d7 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ # Generated files by hugo /public/ /resources/_gen/ +.hugo_build.lock # Executable may be added to repository hugo.exe diff --git a/content/posts/2013-05-22-esta-vivo.md b/content/posts/2013-05-22-esta-vivo.md index 44d19f6..15e5183 100644 --- a/content/posts/2013-05-22-esta-vivo.md +++ b/content/posts/2013-05-22-esta-vivo.md @@ -16,14 +16,14 @@ categories: - noticias - wedding date: "2013-05-22T00:19:00Z" -#publishDate: "2097-01-23T19:09:00Z" +publishDate: "2013-05-22T00:19:00Z" id: 26 title: ¡Está vivo! url: /2013/05/esta-vivo/ --- ¡Está vivo! -En referencia a un clasicazo del cine, me llena de emoción presentar mi nueva web: arenzanaphotography.com. Después de 5 meses de trabajo, lanzo la web que utilizaré de ahora en adelante para publicar mi trabajo y promocionar mi fotografía. Podéis seguir el blog (sólo en inglés) que se centrará en fotografía y negocios. Seguiré actualizando este blog con mi vida personal en la lengua de Cervantes. +En referencia a un clasicazo del cine, me llena de emoción presentar mi nueva [web](http://arenzanaphotography.com/). Después de 5 meses de trabajo, lanzo la web que utilizaré de ahora en adelante para publicar mi trabajo y promocionar mi fotografía. Podéis seguir el blog (sólo en inglés) que se centrará en fotografía y negocios. Seguiré actualizando este blog con mi vida personal en la lengua de Cervantes. Os dejo con las épicas palabras del Dr. Frankenstein. diff --git a/content/posts/2013-06-01-bittorrent-y-la-nueva-nube.md b/content/posts/2013-06-01-bittorrent-y-la-nueva-nube.md index 9678c39..02e751d 100644 --- a/content/posts/2013-06-01-bittorrent-y-la-nueva-nube.md +++ b/content/posts/2013-06-01-bittorrent-y-la-nueva-nube.md @@ -11,7 +11,7 @@ blogger_permalink: categories: - tecnologia date: "2013-06-01T16:03:00Z" -#publishDate: "2097-01-23T19:09:00Z" +publishDate: "2013-06-01T16:03:00Z" id: 25 title: Bittorrent y la nueva nube url: /2013/06/bittorrent-y-la-nueva-nube/ diff --git a/content/posts/2021-02-01-bye-whatsapp.org b/content/posts/2021-02-01-bye-whatsapp.org index 351ad3f..ad71cb9 100644 --- a/content/posts/2021-02-01-bye-whatsapp.org +++ b/content/posts/2021-02-01-bye-whatsapp.org @@ -30,7 +30,7 @@ Abandono WhatsApp, pero no de la noche a la mañana. Empezando en marzo, elimina Pero seguiré aquí, en internet. WhatsApp no es internet, Instagram no es internet. Forman parte de internet, pero La Red es más profunda que todas estas empresas. A partir de ahora, la mejor forma de ponerse en contacto conmigo será a través de [[https://signal.org][Signal]]. A diferencia de WhatsApp o Telegram, Signal es una organización sin ánimo de lucro (no tiene accionistas a los que rendir cuentas) que se sostiene a través de donaciones. Si eres usuario de Signal y lo utilizas regularmente, te animo a que [[https://signal.org/donate/][dones al proyecto]]. -Si realmente prefieres no utilizar algo nuevo y tienes un dispositivo Apple, sigo disponible en iMessage y si eres usuario de Telegram, [[https://t.me/Arenzana][mantendré mi cuenta de Telegram]]. Al menos a corto plazo. Finalmente, para los más aventureros, sigo la evolución del protocolo decentralizado [[https://matrix.org][Matrix]], que realmente creo que es el futuro de las comunicaciones. Puedes encontrarme como ~@arenzana:matrix.org~. +Si realmente prefieres no utilizar algo nuevo y tienes un dispositivo Apple, sigo disponible en iMessage y si eres usuario de Telegram, [[https://t.me/Arenzana][mantendré mi cuenta de Telegram]]. Al menos a corto plazo. Finalmente, para los más aventureros, sigo la evolución del protocolo decentralizado [[https://matrix.org][Matrix]], que realmente creo que es el futuro de las comunicaciones. Puedes contactar conmigo [[https://matrix.to/#/@isma:matrix.mrcol.es][aquí]]. Igualmente, mi uso de Twitter se verá reducido con los meses. [[https://joinmastodon.org/][Mastodon]] es sin duda la mejor alternativa y puedes seguirme [[https://social.mrcol.es/@isma][aquí]]. @@ -55,6 +55,6 @@ But I will remain on the internet. WhatsApp is not the internet, Instagram is no The best way to get in contact with me, will be through [[https://signal.org][Signal]]. Unlike WhatsApp or Telegram, Signal is a 501c-3 (non profit organization) that has no shareholders to please. This also means that if you're a user that enjoys the service, I encourage you to [[https://signal.org/donate/][donate to the project]]. -If you really don't want to use a new service and have an Apple device, I will still be available on iMessage and, if you're a Telegram user, [[https://t.me/Arenzana][I will keep my Telegram account]]. At least in the short term. Finally, for the adventurous ones, I'm keeping an eye on the evolution of the decentralized [[https://matrix.org][Matrix]] protocol, I truly believe it is the future of communications. You can find me as ~@arenzana:matrix.org~. +If you really don't want to use a new service and have an Apple device, I will still be available on iMessage and, if you're a Telegram user, [[https://t.me/Arenzana][I will keep my Telegram account]]. At least in the short term. Finally, for the adventurous ones, I'm keeping an eye on the evolution of the decentralized [[https://matrix.org][Matrix]] protocol, I truly believe it is the future of communications. You can find me [[https://matrix.to/#/@isma:matrix.mrcol.es][here]]. My use of Twitter will be reduced as well, potentially following the fate of WhatsApp. [[https://joinmastodon.org/][Mastodon]] is certainly the best alternative, and you can follow me [[https://social.mrcol.es/@isma][here]]. diff --git a/content/posts/2022-01-11-emacs-rust.org b/content/posts/2022-01-11-emacs-rust.org new file mode 100644 index 0000000..b4c0c07 --- /dev/null +++ b/content/posts/2022-01-11-emacs-rust.org @@ -0,0 +1,44 @@ +#+BLOG: arenzanaorg +#+POSTID: 438 +#+DATE: [2022-01-11 Tue 16:30] +#+OPTIONS: toc:nil num:nil todo:nil pri:nil tags:nil ^:nil +#+CATEGORY: emacs,dev +#+TAGS[]: tech +#+DESCRIPTION: +#+TITLE: Emacs for Rust Development + +* Emacs > Visual Studio Code +There's a good chance I'm a hater or that I don't know what I'm doing. After a couple of hours trying to set up VS Code for Rust development, I ended up frustrated not understanding how to simply call the compiler or the debugger from the interface. I looked for ~rust-mode~ on Github and 15 minutes later I was up and running on Emacs. Maybe it's my previous experience with [Go](https://arenzana.org/posts/2019-12-03-emacs-go-mode-revisited/) development set ups that made it all quite simple. + +* Rust on Emacs +I approached this the same way I approached Go: let's get regular syntax highlighting, linting, formatting, and compiling first and we'll worry about debuggers later. I'm a bit old school when it comes to approaching debugging. +We end up with the following on the Emacs config (if you use ~use-package~): + +#+begin_src emacs-lisp + (use-package rust-mode + :defer t + :ensure t + :init + (add-hook 'rust-mode-hook + (lambda () (setq indent-tabs-mode nil))) + (setq rust-format-on-save t) + (add-hook 'rust-mode-hook + (lambda () (prettify-symbols-mode))) + (add-hook 'rust-mode-hook #'lsp) + :bind (("M-," . rust-compile)) + ) + (use-package flycheck-rust + :ensure t + :hook (flycheck-mode-hook . flycheck-rust-setup)) +#+end_src + +Here, we load the mode for Rust development. Auto-indent with spaces, run ~rustfmt~ on save (needs to be installed via [rustup](https://rustup.rs/). Prettify symbols (cause why not), and use language server protocol. I'm binding "M-," to compile; I know it's an odd keybinding, but I'm used to it by now. Feel free to make it your own. + +In addition to this, I'm hooking ~flycheck~ for linting. + +* Conclusion +IntelliJ made it very easy to set up as well, but that's a multi-hundred dollar application. If you're on a budget, Emacs, vim, or VSCode should bet viable options as well. + +I'm still getting started with Rust and I don't know how much it will stick, since I've been writing Go for a number of years; but I'm happy I have a familiar environment to get started from. By now I should know Emacs should *always* be my first option. + +