English
Sharp is a small compiled language with Rust frontends and a native backend. It is designed to stay simple for beginners while still supporting real tooling, UI generation, installers, interop, and native builds.
한국어
Sharp는 Rust 프론트엔드와 네이티브 백엔드를 사용하는 작은 컴파일 언어입니다. 비전공자도 시작하기 쉽게 유지하면서, 실제 도구 체인, UI 생성, 설치기, 외부 생태계 연동, 네이티브 빌드를 지원하는 것을 목표로 합니다.
- Source extension:
.sharp - Core memory concept:
sharp - Build model: Sharp to native executable through generated C/native backend
- Syntax guide:
docs/SYNTAX.md - Interop guide:
docs/INTEROP.md
English
Small programs can start immediately because beginner mode automatically includes std/prelude.sharp.
한국어
초보자 모드에서는 std/prelude.sharp가 자동 포함되므로 아주 작은 프로그램은 바로 시작할 수 있습니다.
run {
print("hello");
}
English
const: constant valuevalue: inferred read-only valuevariable: inferred mutable valuefn,val,mut,str,nums,texts,show,app: short aliasesnumber,string,numbers,strings: beginner-friendly type namesmap: native keyed text stateresult: native success/error flow valuetext(number)orstring(number): convert numbers to textfunction: explicit function declarationrun { ... }: simplest program entry
한국어
const: 상수value: 타입 추론되는 읽기 전용 값variable: 타입 추론되는 변경 가능한 값fn,val,mut,str,nums,texts,show,app: 짧은 별칭number,string,numbers,strings: 직관적인 타입 이름map: 기본 키-값 상태 타입result: 성공/실패 흐름을 위한 기본 결과 타입text(number)/string(number): 숫자를 문자열로 변환function: 명시적 함수 선언run { ... }: 가장 단순한 진입점
run {
numbers scores = pack(10, 20, 30);
const title = "Sharp";
variable shots = 3;
print(count(scores));
print(title);
}
English
sharp { ... } creates a temporary memory region. sharp text { ... }, sharp map { ... }, and sharp numbers { ... } also work as value expressions. Use keep ...; to move the final value out, defer ...; for cleanup, and emit ...; to build text incrementally.
한국어
sharp { ... }는 임시 메모리 영역을 만듭니다. sharp text { ... }, sharp map { ... }, sharp numbers { ... }는 값 표현식으로도 쓸 수 있습니다. 최종 값은 keep ...;로 꺼내고, 정리 작업은 defer ...;, 텍스트 누적은 emit ...;로 처리합니다.
value label = sharp text {
value prefix = "sharp-";
defer print("leaving sharp");
emit prefix;
emit "text";
};
sharp new my-app
sharp check examples/hello.sharp
sharp build examples/web.sharp
sharp serve examples/web.sharp
sharp add pip requests
sharp add npm dayjssharp new my-app
cd my-app
sharp check
sharp build
sharp serveA project uses sharp.toml and usually starts from main.sharp.
Public entrypoints:
std/prelude.sharpstd/math.sharpstd/text.sharpstd/lists.sharpstd/io.sharpstd/paths.sharpstd/assert.sharpstd/bridge.sharpstd/json.sharpstd/map.sharpstd/result.sharpstd/fs.sharpstd/os.sharpstd/cli.sharpstd/net.sharpstd/http_server.sharpstd/csv.sharpstd/random.sharpstd/stats.sharpstd/vector.sharpstd/matrix.sharpstd/tensor.sharpstd/crypto.sharpstd/security.sharpstd/safe_fs.sharpstd/http.sharpstd/sqlite.sharpstd/logger.sharpstd/config.sharpstd/test.sharpstd/web.sharpstd/mobile.sharpstd/ui.sharpstd/interop.sharp
Direct import:
import "../std/math.sharp";
import "../std/web.sharp";
Installed projects can also use:
import "std/web.sharp";
English
Sharp includes a shared UI model that can render to web HTML, Android Compose, and desktop Compose output.
한국어
Sharp는 공통 UI 모델을 제공하며, 같은 선언에서 웹 HTML, Android Compose, Desktop Compose 출력을 만들 수 있습니다.
Key UI ideas:
- semantic screen model
- shared layout/content/input/state nodes
- structured action metadata
- web, android, desktop output from one screen spec
Example files:
English
Sharp can vendor Python and Node packages into a project and generate wrapper modules for them.
한국어
Sharp는 Python, Node 패키지를 프로젝트 안에 vendor 형태로 설치하고, 바로 import 가능한 wrapper 모듈을 생성할 수 있습니다.
sharp add pip requests
sharp add pip matplotlib
sharp add pip plotly
sharp add pip pillow
sharp add pip openai
sharp add pip fastapi
sharp add pip langchain
sharp add pip transformers
sharp add pip discord.py
sharp add npm dayjs
sharp add npm axios
sharp add npm react
sharp add npm three
sharp add npm express
sharp add npm next
sharp add npm tailwindcss
sharp add npm zustand
sharp add npm discord.jsFor details, see docs/INTEROP.md.
Common generated helpers:
requests.get_text(url)requests.get_json(url)requests.post_json(url, body_json)requests.status_code(url)numpy.array_sum(numbers_json)numpy.mean(numbers_json)pandas.read_csv_head(path, rows)pandas.columns(path)matplotlib.line_svg(title, labels_json, values_json)matplotlib.bar_svg(title, labels_json, values_json)plotly.bar_html(title, labels_json, values_json)plotly.line_html(title, labels_json, values_json)pillow.image_size(path)pillow.thumbnail(path, width, height, output_path)openai.chat_text(model, prompt)fastapi.app_module(name)fastapi.route_module(name, path)langchain.prompt_template(template)langchain.chain_module(model_name)transformers.sentiment_pipeline(model_name, text_value)transformers.text_generator(model_name)discord.py.bot_module(name)discord.py.command_module(name)dayjs.format_now(pattern)dayjs.add_days(iso, days, pattern)dayjs.from_iso(iso, pattern)axios.get_text(url)axios.get_json(url)axios.post_json(url, body_json)axios.status_code(url)react.component(name, title, body)react.page(name, title, body)tailwindcss.config_module(content_glob)tailwindcss.utility_block(classes)zustand.store_module(name)zustand.slice_module(name)three.scene_module(name)three.spinning_cube(name)express.server_module(name)express.route_module(name, path)next.page_module(name, title, body)next.api_route(name)discord.js.bot_module(name)discord.js.command_module(name)
sharp add also generates interop/<package>_example.sharp so a new package comes with a ready-to-run sample file.
sharp check reports syntax and semantic errors without producing a native output file. The toolchain also reports warnings such as:
- unused variable
- unused import
- duplicate import
- unreachable code
- constant condition
- live VS Code diagnostics
English
Sharp is packaged as a native-first toolchain. Most core runtime paths now work without requiring a separate Python installation.
한국어
Sharp는 native-first 툴체인으로 패키징되어 있으며, 주요 런타임 경로는 별도 Python 설치 없이 동작하도록 정리되어 있습니다.
Optional bridges still exist for explicit pycall(...) and nodecall(...) workflows.
examples/hello.sharp: smallest programexamples/web.sharp: web exampleexamples/charts.sharp: chart-first exampleexamples/ui.sharp: shared UI model exampleexamples/mobile.sharp: Android Compose outputexamples/platform.sharp: platform standard library sampleexamples/security.sharp: security-first sampleexamples/server.sharp: minimal HTTP serverexamples/interop.sharp: Python/Node interop sample
make
make check
make distRust workspace metadata is defined in Cargo.toml, while the legacy native backend still lives in the repository for compatibility and migration.