Building a JSX Transpiler with Vite

Vite Setup Bootstrap a new vite project using vanilla template. npm create vite@latest jsx-renderer-vite -- --template vanilla Enter the project and install the dependencies cd jsx-renderer-vite && npm install Then, adjust the project files so that the final structure is like this . ├── src/ │ └── main.jsx ├── .gitignore ├── index.html ├── package-lock.json ├── package.json └── vite.config.js The following files are important for this setup process ...

October 10, 2025 · Adran Carnavale

Pointers vs. Values in Go

Understanding Pointers and Values Values: Direct copies of data. When you pass a struct as a value, Go creates a complete copy. Pointers: References to data in memory. Passing a pointer shares the original data. type Person struct { Name string Age int } func (p Person) Birthday() { // Value receiver p.Age++ // Only modifies the copy } func (p *Person) Birthday() { // Pointer receiver p.Age++ // Modifies the original } Tradeoffs of Using Pointers vs. Values Advantages of Pointers Modification of the receiver: Pointer receivers allow methods to modify the original struct's fields. Value receivers work on a copy, so changes are lost. Efficiency for large structs: Passing a pointer avoids copying the entire struct (which can be expensive for large data). This is especially relevant for structs with many fields or embedded data. Interface compliance: Some interfaces require pointer receivers to ensure the method can access or modify the underlying data without copying. Nil safety in some cases: Pointers can represent "absence" (nil), which is useful for optional or uninitialized structs. Consistency: If any method on a type uses a pointer receiver (e.g., to modify state), all methods should use pointers to avoid confusion and ensure the type behaves uniformly. Disadvantages of Pointers Nil panics: Dereferencing a nil pointer causes a runtime panic, which can crash the program if not handled (e.g., via checks or initialization). Slight overhead: Pointers add a small memory and indirection cost compared to direct values. Concurrency risks: Shared pointers can lead to race conditions in concurrent code if not protected (e.g., with mutexes), as multiple goroutines might modify the same data. Less safe for small structs: For tiny structs (e.g., with just a few int fields), copying is often faster and safer than indirection. Immutability loss: Values promote immutability by default, while pointers allow accidental mutation. Advantages of Values Safety and simplicity: No nil panics, and methods can't accidentally modify the original data (promotes immutability). Performance for small data: Copying small structs (e.g., primitives or simple aggregates) is often cheaper than pointer indirection. Thread safety: Values are inherently safe in concurrent contexts since each call gets a copy. Disadvantages of Values No modification: Methods can't change the original struct; they must return updated copies. Inefficiency for large data: Copying large structs wastes memory and CPU, especially in loops or recursive calls. Interface limitations: Some APIs require pointers to allow state changes across calls. General Guidelines for Using Pointers vs. Values Use pointers when The method needs to modify the receiver's fields (e.g., updating state in a model). The struct is large (rule of thumb: >1-2 words in size, or contains slices/maps/channels). Required by an interface or framework. The struct might be nil or optional (e.g., error handling). For consistency: If any method on the type uses a pointer, use pointers for all methods to avoid mixing semantics. Use values when The struct is small and immutable (e.g., coordinates, simple configs). Methods don't need to modify the receiver (e.g., getters like `Title()` or `Description()`). You want to ensure thread safety without locks (each call gets a safe copy). The type is a primitive or basic aggregate (e.g., `time.Time` often uses values for simplicity). Receiver rules Value receivers: Can be called on both values and pointers (Go auto-dereferences). Pointer receivers: Can only be called on pointers (Go auto-takes address for addressable values, like variables). If in doubt, profile performance—pointers aren't always faster (e.g., small structs copy quickly).

September 29, 2025 · Adran Carnavale

Concurrency in Go

Concurrency in Go is handled via goroutines and can improve performance by allowing efficient multitasking even on a single CPU core, primarily through better resource utilization and responsiveness. Concurrency vs. Parallelism Concurrency is about structuring a program to handle multiple tasks simultaneously, while parallelism is about executing them at the same time on multiple CPU cores. Go's runtime scheduler interleaves goroutines quickly, making it feel concurrent even if only one core is active. ...

August 31, 2025 · Adran Carnavale

LuaLS Type Annotations

Check out the official documentation for more on Github What are LuaLS Annotations? LuaLS annotations are special comments prefixed with --- that provide type information to the language server. These annotations help the server understand your code better, enabling features like: Type checking and error detection Intelligent autocompletion Better signature help Basic Syntax and Formatting --- This is a basic annotation --- --- *Bold text* and /italic text/ are supported Core Type System LuaLS recognizes all standard Lua types, such as `nil`, `any`, `boolean`, `string`, and more. ...

August 31, 2025 · Adran Carnavale

Docker mangement in Neovim

lazydocker.nvim is my personal Neovim plugin project that brings the power of lazydocker directly into your editor workflow Check out the project source code on Github `lazydocker.nvim` is a Lua-based Neovim plugin that allows you to open lazydocker in a floating window without ever leaving your editor. This means you can quickly check on your containers, view logs, or manage services, and then get right back to your code with a single keystroke. ...

August 24, 2025 · Adran Carnavale

Event-Driven Architectures with AWS CDK

Preamble Imagine you're building a communications platform that needs to process messages from multiple providers. Each provider has different message formats, authentication requirements, and processing logic. You need: API endpoints to receive incoming messages Message queues to handle traffic spikes Lambda functions to process different message types Media storage for attachments Comprehensive monitoring and alerting Rate limiting and security controls Managing this infrastructure manually through the AWS console would be error-prone and time-consuming. CloudFormation templates help, but they can become complex and hard to maintain as your infrastructure grows. ...

July 30, 2025 · Adran Carnavale

An AI-Powered Food Image Analysis API

DietLogApp is a powerful, AI-driven application designed to analyze food images and provide detailed nutritional feedback. Check out the project source code on Github Features AI-Powered Image Analysis: Utilizes a powerful AI model to analyze food images and identify ingredients. Detailed Nutritional Feedback: Provides a comprehensive nutritional breakdown, including a health score and suggestions for improvement. Streaming Responses: Delivers nutritional feedback in real-time through streaming, enhancing the user experience. Simple Web Interface: Includes a basic HTML interface for easy interaction with the API. Dockerized: Comes with a Dockerfile for easy setup and deployment. Scalable Architecture: Built with a modular and scalable architecture, making it easy to extend and maintain.

May 11, 2025 · Adran Carnavale

Contributing ESLint Support to nvim-lspconfig

My recent contribution to the neovim/nvim-lspconfig repository adds comprehensive eslint language server support using the modern `vim.lsp.config` api. this pull request addresses issue #3075. Check out the pull request #3731 nvim-lspconfig is the official Neovim plugin that provides quickstart configurations for Language Server Protocol (LSP) clients. With the release of Neovim 0.11, the project has been transitioning from the legacy `require'lspconfig'.setup{}` pattern to the new `vim.lsp.config` API. This modernization effort requires updating all existing configurations to use the new pattern. ...

April 27, 2025 · Adran Carnavale