Multi-language development support
๋ฒ์ : 1.0.0
๊ฒ์ฆ ํ๊ฒฝ: Ubuntu 24.04 LTS (Claude Code)
์ต์ข
์์ : 2025-01-XX
๋์ ์ธ์ด: C#, Swift, Ruby, PHP, R, Perl
Claude Code์ Linux ํ๊ฒฝ์์ ๋ถ๋ถ ์ง์ ์ธ์ด๋ฅผ ์์ ์ง์ ์์ค์ผ๋ก ์ ํํ๋ ์ข ํฉ ๊ฐ์ด๋์ ๋๋ค.
| ์ธ์ด | ๋ฒ์ | ์ค์น ๋ฐฉ๋ฒ | ์์ ์๊ฐ | ๋์ด๋ |
|---|---|---|---|---|
| C# | .NET 8.0 | apt | ~2๋ถ | ๐ข ์ฌ์ |
| Swift | 5.10 | ์๋ | ~8๋ถ | ๐ ์ด๋ ค์ |
| Ruby | 3.3 | RVM/apt | ~5๋ถ | ๐ก ์ค๊ฐ |
| PHP | 8.3 | apt | ~1๋ถ | ๐ข ์ฌ์ |
| R | 4.4 | apt+์ ์ฅ์ | ~3๋ถ | ๐ก ์ค๊ฐ |
| Perl | 5.38 | ๊ธฐ๋ณธ ํฌํจ | 0๋ถ | ๐ข ์ฌ์ |
์ด ์คํฌ์ ์ฌ์ฉํด์ผ ํ๋ ๊ฒฝ์ฐ:
# .NET 8.0 SDK ์ค์น (๊ณต์ Microsoft ์ ์ฅ์)
sudo apt-get update
sudo apt-get install -y dotnet-sdk-8.0
# ํ์ธ
dotnet --version # ์ถ๋ ฅ: 8.0.xxx
# ์ฝ์ ์ฑ
dotnet new console -n MyConsoleApp
cd MyConsoleApp
dotnet run
# ASP.NET Core ์น API
dotnet new webapi -n MyWebApi
cd MyWebApi
dotnet run # http://localhost:5000
// Program.cs
using System;
using System.Linq;
Console.WriteLine("Hello from C# on Linux!");
// LINQ ์์
var numbers = new[] { 1, 2, 3, 4, 5 };
var squares = numbers.Select(n => n * n);
Console.WriteLine($"Squares: {string.Join(", ", squares)}");
# GPG ํค ์ถ๊ฐ
sudo apt install gnupg ca-certificates
sudo gpg --homedir /tmp --no-default-keyring \
--keyring /usr/share/keyrings/mono-official-archive-keyring.gpg \
--keyserver hkp://keyserver.ubuntu.com:80 \
--recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
# Mono ์ ์ฅ์ ์ถ๊ฐ
echo "deb [signed-by=/usr/share/keyrings/mono-official-archive-keyring.gpg] https://download.mono-project.com/repo/ubuntu stable-focal main" | \
sudo tee /etc/apt/sources.list.d/mono-official-stable.list
# ์ค์น
sudo apt update
sudo apt install mono-complete
# ํ์ธ
mono --version
# ์คํ
mono MyApp.exe
sudo apt-get install \
binutils \
git \
gnupg2 \
libc6-dev \
libcurl4-openssl-dev \
libedit2 \
libgcc-11-dev \
libpython3-dev \
libsqlite3-0 \
libstdc++-11-dev \
libxml2-dev \
libz3-dev \
pkg-config \
tzdata \
unzip \
zlib1g-dev
# ๋ค์ด๋ก๋ (Ubuntu 24.04 ์ ์ฉ)
cd /tmp
wget https://download.swift.org/swift-5.10-release/ubuntu2404/swift-5.10-RELEASE/swift-5.10-RELEASE-ubuntu24.04.tar.gz
# ์์ถ ํด์
tar xzf swift-5.10-RELEASE-ubuntu24.04.tar.gz -C /home/claude/
# PATH ์ค์
export PATH="/home/claude/swift-5.10-RELEASE-ubuntu24.04/usr/bin:$PATH"
# .bashrc์ ์๊ตฌ ์ ์ฅ
echo 'export PATH="/home/claude/swift-5.10-RELEASE-ubuntu24.04/usr/bin:$PATH"' >> ~/.bashrc
# ํ์ธ
swift --version
# ์คํ ๊ฐ๋ฅํ ์ฑ
mkdir MySwiftApp
cd MySwiftApp
swift package init --type executable
# ๋น๋ & ์คํ
swift build
swift run
// swift-tools-version: 5.10
import PackageDescription
let package = Package(
name: "MySwiftApp",
platforms: [
.macOS(.v13),
.linux
],
dependencies: [
.package(url: "https://github.com/apple/swift-nio.git", from: "2.65.0")
],
targets: [
.executableTarget(
name: "MySwiftApp",
dependencies: [
.product(name: "NIO", package: "swift-nio")
]
)
]
)
// Sources/MySwiftApp/main.swift
import Foundation
print("Hello from Swift on Linux!")
// ๋ฐฐ์ด ์ฒ๋ฆฌ
let numbers = [1, 2, 3, 4, 5]
let squares = numbers.map { $0 * $0 }
print("Squares: \(squares)")
// ๋น๋๊ธฐ ์์
Task {
try await Task.sleep(nanoseconds: 1_000_000_000)
print("1 second passed")
}
// ๋ฉ์ธ ์ค๋ ๋ ์ ์ง
RunLoop.main.run(until: Date(timeIntervalSinceNow: 2))
# RVM ์ค์น
curl -sSL https://get.rvm.io | bash -s stable
# RVM ํ์ฑํ
source ~/.rvm/scripts/rvm
# Ruby 3.3.0 ์ค์น
rvm install 3.3.0
rvm use 3.3.0 --default
# ํ์ธ
ruby --version # ruby 3.3.0
gem --version # 3.5.x
sudo apt-get install ruby-full
ruby --version # ruby 3.2.x (Ubuntu 24 ๊ธฐ๋ณธ)
gem install bundler
# Rails ์ค์น
gem install rails
# ํ๋ก์ ํธ ์์ฑ
rails new myapp --database=sqlite3
cd myapp
# ์์กด์ฑ ์ค์น
bundle install
# ์๋ฒ ์คํ
rails server # http://localhost:3000
# hello.rb
puts "Hello from Ruby on Linux!"
# ๋ฐฐ์ด ์ฒ๋ฆฌ
numbers = [1, 2, 3, 4, 5]
squares = numbers.map { |n| n * n }
puts "Squares: #{squares.inspect}"
# ํด๋์ค ์์
class Greeter
def initialize(name)
@name = name
end
def greet
"Hello, #{@name}!"
end
end
greeter = Greeter.new("Claude")
puts greeter.greet
# ์คํ: ruby hello.rb
# Gemfile
source 'https://rubygems.org'
gem 'sinatra', '~> 3.1'
gem 'rack', '~> 3.0'
gem 'puma', '~> 6.4'
# ์ค์น: bundle install
# PHP 8.3 ์ค์น (Ubuntu 24 ๊ธฐ๋ณธ)
sudo apt-get install php8.3 php8.3-cli php8.3-common php8.3-mbstring php8.3-xml php8.3-curl
# ํ์ธ
php --version # PHP 8.3.x
# Composer ์ค์น
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php --install-dir=/usr/local/bin --filename=composer
rm composer-setup.php
# ํ์ธ
composer --version
# Laravel ์ค์น
composer create-project laravel/laravel myapp
cd myapp
# ๊ฐ๋ฐ ์๋ฒ ์คํ
php artisan serve # http://localhost:8000
<?php
// hello.php
echo "Hello from PHP on Linux!\n";
// ๋ฐฐ์ด ์ฒ๋ฆฌ
$numbers = [1, 2, 3, 4, 5];
$squares = array_map(fn($n) => $n * $n, $numbers);
echo "Squares: " . implode(", ", $squares) . "\n";
// ํด๋์ค ์์
class Greeter {
private $name;
public function __construct($name) {
$this->name = $name;
}
public function greet() {
return "Hello, {$this->name}!";
}
}
$greeter = new Greeter("Claude");
echo $greeter->greet() . "\n";
// ์คํ: php hello.php
# public ๋๋ ํ ๋ฆฌ ์๋น
php -S localhost:8000 -t public/
# ๋จ์ ์คํฌ๋ฆฝํธ ์๋น
php -S localhost:8000
{
"require": {
"php": "^8.3",
"symfony/http-foundation": "^6.4",
"guzzlehttp/guzzle": "^7.8"
},
"autoload": {
"psr-4": {
"App\\": "src/"
}
}
}
# ์์กด์ฑ ์ค์น
sudo apt update -qq
sudo apt install --no-install-recommends software-properties-common dirmngr
# CRAN ์ ์ฅ์ ์ถ๊ฐ
sudo add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/"
# R ์ค์น
sudo apt install r-base r-base-dev
# ํ์ธ
R --version # R version 4.4.0
# R ์คํ
R
# R ์ฝ์์์
install.packages("tidyverse")
install.packages("ggplot2")
install.packages("dplyr")
install.packages("readr")
# ์ข
๋ฃ: q()
# hello.R
print("Hello from R on Linux!")
# ๋ฒกํฐ ์ฒ๋ฆฌ
numbers <- c(1, 2, 3, 4, 5)
squares <- numbers ^ 2
print(paste("Squares:", paste(squares, collapse=", ")))
# ๋ฐ์ดํฐํ๋ ์ ์์
df <- data.frame(
name = c("Alice", "Bob", "Charlie"),
age = c(25, 30, 35),
score = c(85, 92, 88)
)
print(df)
# tidyverse ์ฌ์ฉ
library(dplyr)
result <- df %>%
filter(age > 28) %>%
select(name, score)
print(result)
# ์คํ: Rscript hello.R
# plot.R
library(ggplot2)
# ์ํ ๋ฐ์ดํฐ
data <- data.frame(
x = 1:10,
y = (1:10)^2
)
# ๊ทธ๋ํ ์์ฑ ๋ฐ ์ ์ฅ
p <- ggplot(data, aes(x=x, y=y)) +
geom_line(color="blue", size=1) +
geom_point(color="red", size=3) +
labs(title="Square Numbers", x="Number", y="Square")
ggsave("plot.png", plot=p, width=8, height=6)
print("Plot saved to plot.png")
# ์คํ: Rscript plot.R
perl --version # perl 5.38.2
# cpanminus ์ค์น (๋ชจ๋ ๊ด๋ฆฌ์)
sudo apt-get install cpanminus
# ๋ชจ๋ ์ค์น ์์
cpanm Mojolicious
cpanm DBI
cpanm LWP::UserAgent
#!/usr/bin/env perl
use strict;
use warnings;
use v5.38;
say "Hello from Perl on Linux!";
# ๋ฐฐ์ด ์ฒ๋ฆฌ
my @numbers = (1, 2, 3, 4, 5);
my @squares = map { $_ * $_ } @numbers;
say "Squares: " . join(", ", @squares);
# ํด์ ์์
my %person = (
name => "Alice",
age => 30,
city => "Seoul"
);
say "Name: $person{name}, Age: $person{age}";
# ์คํ: perl hello.pl
# ๋๋: chmod +x hello.pl && ./hello.pl
#!/usr/bin/env perl
use Mojolicious::Lite;
get '/' => sub {
my $c = shift;
$c->render(text => 'Hello from Perl web app!');
};
app->start;
# ์คํ: perl myapp.pl daemon
# ์ ์: http://localhost:3000
๋ชจ๋ ์ธ์ด๋ฅผ ํ ๋ฒ์ ํ ์คํธ:
#!/bin/bash
# test_all_languages.sh
echo "=== Testing C# ==="
dotnet --version && echo "โ
C# OK" || echo "โ C# Failed"
echo "=== Testing Swift ==="
swift --version && echo "โ
Swift OK" || echo "โ Swift Failed"
echo "=== Testing Ruby ==="
ruby --version && echo "โ
Ruby OK" || echo "โ Ruby Failed"
echo "=== Testing PHP ==="
php --version && echo "โ
PHP OK" || echo "โ PHP Failed"
echo "=== Testing R ==="
R --version && echo "โ
R OK" || echo "โ R Failed"
echo "=== Testing Perl ==="
perl --version && echo "โ
Perl OK" || echo "โ Perl Failed"
# ์คํ: chmod +x test_all_languages.sh && ./test_all_languages.sh
# 1. ํ๋ก์ ํธ ์์ฑ
dotnet new webapi -n MyApi
cd MyApi
# 2. ์คํ
dotnet run
# 3. ํ
์คํธ (๋ค๋ฅธ ํฐ๋ฏธ๋)
curl http://localhost:5000/weatherforecast
# 4. ๋ฆด๋ฆฌ์ฆ ๋น๋
dotnet publish -c Release -o ./publish
# 1. Vapor ์ค์น
git clone https://github.com/vapor/template.git my-vapor-app
cd my-vapor-app
# 2. ๋น๋
swift build
# 3. ์คํ
swift run
# 4. ํ
์คํธ
curl http://localhost:8080
# 1. Rails ์ฑ ์์ฑ
rails new blog
cd blog
# 2. ์ค์บํด๋ ์์ฑ
rails generate scaffold Post title:string body:text
# 3. ๋ง์ด๊ทธ๋ ์ด์
rails db:migrate
# 4. ์๋ฒ ์คํ
rails server
# 5. ํ
์คํธ
curl http://localhost:3000/posts
์์ธ: PATH ์ค์ ๋๋ฝ
ํด๊ฒฐ:
# ํ์ฌ ์ธ์
์์ ์ค์
export PATH="/์ค์น/๊ฒฝ๋ก/bin:$PATH"
# ์๊ตฌ ์ค์
echo 'export PATH="/์ค์น/๊ฒฝ๋ก/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
# ํ์ธ
which [command]
์์ธ: ์ ์ฅ์ ์ ๋ฐ์ดํธ ํ์
ํด๊ฒฐ:
# ์ ์ฅ์ ์
๋ฐ์ดํธ
sudo apt-get update
# ์บ์ ์ ๋ฆฌ
sudo apt-get clean
sudo apt-get autoclean
# ์ฌ์๋
sudo apt-get install [package]
์์ธ: ์ฌ๋ฌ ๋ฒ์ ๋์ ์ค์น
ํด๊ฒฐ:
# ์ค์น๋ ๋ชจ๋ ๋ฒ์ ํ์ธ
which -a [command]
# ๋ฒ์ ๊ด๋ฆฌ ๋๊ตฌ ์ฌ์ฉ (Ruby ์์)
rvm use 3.3.0
# ๋๋ ํน์ ๊ฒฝ๋ก ์ฐ์ ์์
export PATH="/์ํ๋/๋ฒ์ /๊ฒฝ๋ก:$PATH"
์์ธ: Claude Code๋ ์ ํ๋ sudo ๊ถํ
ํด๊ฒฐ:
# sudo ์์ด ๊ฐ๋ฅํ ๋์ ์ฐพ๊ธฐ
# ์: RVM์ผ๋ก Ruby ์ค์น (sudo ๋ถํ์)
curl -sSL https://get.rvm.io | bash
# ์ฌ์ฉ์ ๋๋ ํ ๋ฆฌ์ ์ค์น
./configure --prefix=$HOME/local
make && make install
์์ธ: ์ผ๋ถ URL ์ ๊ทผ ์ ํ
ํด๊ฒฐ:
# ํ์ฉ๋ ๊ณต์ URL ์ฌ์ฉ
# Swift: https://download.swift.org (ํ์ฉ)
# Ruby: https://get.rvm.io (ํ์ฉ)
# ๊ธฐํ: ๊ณต์ apt ์ ์ฅ์ ์ฌ์ฉ
# ๋๋ฝ๋ ํจํค์ง ์ค์น
sudo apt-get install libpython3-dev
# Swift ์ฌ์ค์น
rm -rf ~/swift-5.10-*
# (์ ์ค์น ๊ณผ์ ๋ฐ๋ณต)
# ๋ค์ดํฐ๋ธ ํ์ฅ ์ปดํ์ผ ๋๊ตฌ ์ค์น
sudo apt-get install build-essential
# ์ฌ์๋
gem install [gem-name]
# ํ๊ตญ ๋ฏธ๋ฌ ์ฌ์ฉ
composer config -g repos.packagist composer https://packagist.kr
# ๋ณ๋ ฌ ๋ค์ด๋ก๋ ํ์ฑํ
composer global require hirak/prestissimo
# ์ปดํ์ผ ๋๊ตฌ ์ค์น
sudo apt-get install build-essential gfortran
# R ์ฌ์์ ํ ์ฌ์๋
R
> install.packages("tidyverse")
๋ณด์
์ฑ๋ฅ
์ ์ง๋ณด์
์ํ
๋นํจ์จ
ํธํ์ฑ
# AOT(Ahead-of-Time) ์ปดํ์ผ
dotnet publish -c Release -r linux-x64 --self-contained
# ํธ๋ฆฌ๋ฐ (์ฌ์ฉํ์ง ์๋ ์ฝ๋ ์ ๊ฑฐ)
dotnet publish -c Release -p:PublishTrimmed=true
# ๋ฆด๋ฆฌ์ฆ ๋น๋ (์ต์ ํ ๋ ๋ฒจ -O)
swift build -c release
# ํฌ๊ธฐ ์ต์ ํ
swift build -c release -Xswiftc -O -Xswiftc -wmo
# MJIT ํ์ฑํ (Ruby 3.x)
ruby --jit script.rb
# ๋ฉ๋ชจ๋ฆฌ ํ๋กํ์ผ๋ง
ruby --jit-verbose=1 script.rb
# OPcache ํ์ฑํ
php -d opcache.enable_cli=1 script.php
# JIT ํ์ฑํ (PHP 8.0+)
php -d opcache.jit=tracing -d opcache.jit_buffer_size=100M script.php
# ๋ฒกํฐํ ์ฌ์ฉ (10-100๋ฐฐ ๋น ๋ฆ)
result <- sapply(1:1000000, function(x) x * 2) # ๋๋ฆผ
result <- (1:1000000) * 2 # ๋น ๋ฆ
# ๋ณ๋ ฌ ์ฒ๋ฆฌ
library(parallel)
cl <- makeCluster(detectCores())
result <- parSapply(cl, 1:1000000, function(x) x * 2)
stopCluster(cl)
์ด ์คํฌ์ ์ฌ์ฉํ๋ฉด Claude Code์์ "๋ถ๋ถ ์ง์" ์ธ์ด๋ฅผ ์ค์ง์ ์ผ๋ก "์์ ์ง์" ์์ค์ผ๋ก ์ฌ์ฉํ ์ ์์ต๋๋ค!
Happy Coding! ๐