Empezando
Cada lenguaje de programación tiene su propia forma de comenzar. Aquí está cómo crear un programa simple "Hello, World!" en cada lenguaje.
Resumen de Lenguajes
- JavaScript
- PHP
- Rust
- Go
- Python
- Zig
- C#
- C++
- C
- Java
- Ruby
- Swift
Type: Interpreted, dynamically typed
Paradigm: Multi-paradigm (procedural, object-oriented, functional)
Runtime: Node.js (server-side) or browser (client-side)
Installation:
- Download from nodejs.org
- Or use package managers:
brew install node(macOS),apt install nodejs(Linux)
Official Documentation: developer.mozilla.org
Verification:
After installation, verify your setup:
node --versionType: Interpreted, dynamically typed
Paradigm: Multi-paradigm (procedural, object-oriented, functional)
Runtime: PHP CLI or web server (Apache/Nginx)
Installation:
- Download from php.net
- Or use package managers:
brew install php(macOS),apt install php(Linux)
Official Documentation: php.net/manual
Verification:
After installation, verify your setup:
php --versionType: Compiled, statically typed
Paradigm: Multi-paradigm (systems, functional, object-oriented features)
Runtime: Native binary
Installation:
- Install via rustup.rs
- Command:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Official Documentation: doc.rust-lang.org
Verification:
After installation, verify your setup:
rustc --versionType: Compiled, statically typed
Paradigm: Multi-paradigm (procedural, concurrent)
Runtime: Native binary
Installation:
- Download from go.dev
- Or use package managers:
brew install go(macOS),apt install golang-go(Linux)
Official Documentation: go.dev/doc
Verification:
After installation, verify your setup:
go versionType: Interpreted, dynamically typed
Paradigm: Multi-paradigm (procedural, object-oriented, functional)
Runtime: Python interpreter (CPython, PyPy, etc.)
Installation:
- Download from python.org
- Or use package managers:
brew install python(macOS),apt install python3(Linux)
Official Documentation: docs.python.org
Verification:
After installation, verify your setup:
python --version # or python3 --versionType: Compiled, statically typed
Paradigm: Systems programming
Runtime: Native binary
Installation:
- Download from ziglang.org
- Or use package managers:
brew install zig(macOS)
Official Documentation: ziglang.org/documentation
Verification:
After installation, verify your setup:
zig versionType: Compiled (JIT), statically typed
Paradigm: Object-oriented, multi-paradigm
Runtime: .NET runtime (CLR)
Installation:
- Download .NET SDK from dotnet.microsoft.com
- Or use package managers:
brew install dotnet(macOS),apt install dotnet-sdk-8.0(Linux)
Official Documentation: learn.microsoft.com/dotnet
Verification:
After installation, verify your setup:
dotnet --versionType: Compiled, statically typed
Paradigm: Multi-paradigm (procedural, object-oriented, generic)
Runtime: Native binary
Installation:
- Install compiler:
g++(GCC) orclang++(Clang) - macOS:
xcode-select --installorbrew install gcc - Linux:
apt install build-essential
Official Documentation: cppreference.com
Verification:
After installation, verify your setup:
g++ --version # or clang++ --versionType: Compiled, statically typed
Paradigm: Procedural, imperative
Runtime: Native binary
Installation:
- Install compiler:
gcc(GCC) orclang(Clang) - macOS:
xcode-select --installorbrew install gcc - Linux:
apt install build-essential
Official Documentation: en.cppreference.com/w/c
Verification:
After installation, verify your setup:
gcc --version # or clang --versionType: Compiled (to bytecode), statically typed
Paradigm: Object-oriented, multi-paradigm
Runtime: JVM (Java Virtual Machine)
Installation:
- Download JDK from oracle.com/java or adoptium.net
- Or use package managers:
brew install openjdk(macOS),apt install default-jdk(Linux)
Official Documentation: docs.oracle.com/javase
Verification:
After installation, verify your setup:
java -version javac -versionType: Interpreted, dynamically typed
Paradigm: Multi-paradigm (object-oriented, functional, procedural)
Runtime: Ruby interpreter (MRI, JRuby, etc.)
Installation:
- Download from ruby-lang.org
- Or use package managers:
brew install ruby(macOS),apt install ruby-full(Linux) - Or use version managers:
rbenv,rvm
Official Documentation: ruby-lang.org/documentation
Verification:
After installation, verify your setup:
ruby --versionType: Compiled, statically typed
Paradigm: Multi-paradigm (object-oriented, functional, protocol-oriented)
Runtime: Native binary or Swift runtime
Installation:
- macOS: Included with Xcode (download from App Store)
- Linux: Download from swift.org/download
- Or use package managers:
brew install swift(macOS)
Official Documentation: swift.org/documentation
Verification:
After installation, verify your setup:
swift --versionRequisitos Previos
Antes de empezar a programar, asegúrate de tener:
- Un editor de texto o IDE (VS Code, Vim, IntelliJ, etc.)
- El runtime/compilador del lenguaje instalado (ver instrucciones de instalación arriba)
- Acceso a la Terminal/Línea de comandos para ejecutar tus programas
- Comprensión básica de la línea de comandos
Hello World
- JavaScript
- PHP
- Rust
- Go
- Python
- Zig
- C#
- C++
- C
- Java
- Ruby
- Swift
// JavaScript (Node.js)
console.log('Hello, World!');
<?php
echo "Hello, World!";
?>
fn main() {
println!("Hello, World!");
}
package main
import "fmt"
func main() {
fmt.Println("Hello, World!")
}
# Python
print("Hello, World!")
const std = @import("std");
pub fn main() !void {
const stdout = std.io.getStdOut().writer();
try stdout.print("Hello, World!\n", .{});
}
using System;
class Program
{
static void Main()
{
Console.WriteLine("Hello, World!");
}
}
#include <iostream>
int main() {
std::cout << "Hello, World!" << std::endl;
return 0;
}
#include <stdio.h>
int main() {
printf("Hello, World!\n");
return 0;
}
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
# Ruby
puts "Hello, World!"
import Swift
print("Hello, World!")
Ejecutando Tu Primer Programa
- JavaScript
- PHP
- Rust
- Go
- Python
- Zig
- C#
- C++
- C
- Java
- Ruby
- Swift
node hello.js
php hello.php
rustc hello.rs
./hello
go run hello.go
python hello.py
zig build-exe hello.zig
./hello
csc hello.cs
./hello.exe
g++ hello.cpp -o hello
./hello
gcc hello.c -o hello
./hello
javac HelloWorld.java
java HelloWorld
ruby hello.rb
swift hello.swift
Puntos Clave
-
Diversidad de paradigmas -- Los lenguajes abarcan desde procedural (C) hasta multi-paradigma (JavaScript, Python, Rust) y enfocados en sistemas (Zig). Por ejemplo, C te mantiene cerca de la máquina con un modelo procedural mínimo, mientras que Rust y Swift combinan programación de sistemas con características funcionales y orientadas a objetos. JavaScript y Python soportan múltiples paradigmas: puedes escribir código imperativo, POO o funcional en el mismo archivo. Al elegir un lenguaje, elige C o Zig para control de bajo nivel; Rust, Go o Swift para rendimiento de sistemas con ergonomía moderna; y JavaScript, Python o Ruby para iteración rápida y amplio soporte de ecosistema.
-
Sistemas de tipado -- Los lenguajes compilados (Rust, Go, C++, Java, Swift, Zig) tienen tipado estático, lo que significa que los errores de tipo se detectan antes de que el programa se ejecute. Los lenguajes interpretados (JavaScript, Python, PHP, Ruby) tienen tipado dinámico, por lo que puedes reasignar variables a diferentes tipos (
let x = 42; x = "hello"en JavaScript). El tipado estático ofrece garantías más fuertes y mejor soporte de IDE; el tipado dinámico favorece la creación rápida de prototipos. Para bases de código grandes y de larga vida, prefiere Rust, Go, Java o C#; para scripts y prototipos, Python o JavaScript suelen ser suficientes. -
Modelos de ejecución -- Los lenguajes compilados (C, C++, Rust, Go, Zig, Swift) producen código máquina nativo; ejecutas el binario directamente. JavaScript usa Node.js o el navegador; Java usa la JVM; C# usa el runtime .NET. Python y Ruby usan intérpretes que ejecutan el código fuente línea por línea. Los binarios compilados arrancan rápido y a menudo se ejecutan más rápido; los lenguajes basados en runtime ofrecen facilidad multiplataforma y características dinámicas. Elige lenguajes compilados para despliegues críticos en rendimiento o independientes; elige runtimes para backends web y aplicaciones multiplataforma.
-
Requisitos de punto de entrada -- Los lenguajes estilo C requieren un
main()explícito (por ejemplo,fn main()en Rust,func main()en Go,int main()en C). Python y Ruby ejecutan código de nivel superior desde la primera línea;print("Hello")al inicio de un archivo se ejecuta inmediatamente. Go requiere de forma única tantopackage maincomofunc main()en el mismo paquete. Java y C# vinculan los puntos de entrada a una clase (public static void main). Al cambiar de lenguaje, ten en cuenta estas diferencias: algunos esperan una única función de entrada, otros ejecutan scripts de arriba a abajo. -
Configuración y verificaci ón -- Cada lenguaje tiene su propio instalador y comando de versión:
node --version,python3 --version,rustc --version,go version, etc. Usa estos para confirmar tu entorno antes de programar. Para lenguajes de sistemas (C, C++, Rust, Zig), típicamente compilas y luego ejecutas; para lenguajes interpretados o basados en runtime, ejecutas el código fuente o bytecode directamente. Prefiere los instaladores oficiales (por ejemplo, rustup para Rust, instaladores de SDK para .NET y Java) para la experiencia más fluida.