広告が嫌いですか? 行く 広告なし 今日

Julia Code Formatter

開発者文章
[iotools_julia_code_formatter]

ガイド

Julia Code Formatter

Julia Code Formatter

Paste any Julia (.jl) source and get instantly reformatted output following the conventions used by the wider Julia scientific-computing community. The tool runs entirely in your browser — no Julia runtime, no server round-trip — so even confidential research or proprietary code can be cleaned up safely.

The formatter mirrors the default style of JuliaFormatter.jl: four-space indentation, consistent spacing around binary operators, tight type annotations such as x::IntT <: Real, preserved juxtaposition multiplication like , and a configurable soft line-length warning at 92 characters.

使用方法

  1. Paste your Julia code into the Julia Code textarea, or click 例を試してみてください。 to load a sample module.
  2. を選択してください インデントスタイル — four spaces is the JuliaFormatter default, two spaces and tabs are also available.
  3. 調整する 行の長さ slider if your team uses a width other than 92 characters. Long lines are reported but never broken automatically, so the result stays syntactically equivalent.
  4. トグル spacing around binary operators, tight type-annotation spacing, preserve commentsと、 collapse multiple blank lines to taste.
  5. クリック 形式. Copy the result with the clipboard button or download it as a .jl ファイル。

機能

  • JuliaFormatter default style – four-space indentation, blank-line conventions, and consistent operator spacing out of the box.
  • Block-aware indentation – correctly handles function, if/elseif/else, for, while, try/catch/finally, let, begin, do, module, struct, quote, macroと、 abstract type/primitive type declarations.
  • Unicode-aware tokenizer – recognises Greek-letter and other Unicode identifiers such as π, α, θと、 Δ.
  • Juxtaposition multiplication preserved – numeric coefficients written as または 0.5x stay tight, while explicit 2 * π stays spaced.
  • Tight type annotationsx::Int, T <: Realと、 Vector{<:Shape} remain compact.
  • Comments and strings respected – line comments (#), nestable block comments (#=…=#), triple-quoted strings, prefixed strings (r"…", raw"…"), char literals, and string interpolation are left intact.
  • Soft line-length report – exceeding lines are counted so you can refactor manually without the formatter breaking semantics.
  • ワンクリックでコピーとダウンロード as formatted.jl.
  • 100%クライアントサイド – nothing leaves your browser.

よくある質問

  1. What style guide does the JuliaFormatter default follow?

    The JuliaFormatter.jl default style is the most widely adopted convention in the Julia community. It uses four-space indentation, surrounds most binary operators with single spaces, keeps type annotations and subtype operators tight (e.g. x::Int, T<:Real), preserves juxtaposition multiplication such as , and targets a soft line width of about 92 characters. Several Julia-organisation packages bundle this style as the baseline for contributions.

  2. Why does Julia allow numbers and identifiers to be written together without an operator?

    Julia treats a numeric literal immediately followed by an identifier or parenthesised expression as implicit multiplication — a feature called juxtaposition. So means 2 * π, 0.5x means 0.5 * xと、 3(a + b) means 3 * (a + b). The numeric literal must come first; the reverse (π2) is not valid because Julia cannot tell whether it is a multiplication or part of an identifier name. Style-wise, the convention is to keep juxtaposition tight without an inserted space.

  3. How are Julia block structures different from C-style languages?

    Julia uses keyword-delimited blocks instead of curly braces. Almost every block opener — function, if, for, while, let, begin, try, do, module, struct, macro, quoteと、 abstract type/primitive type — is closed by a matching end token. Continuers like elseif, else, catchと、 finally sit at the same indentation as the opener but introduce a new body at the next deeper level. This makes Julia code visually closer to Ruby or Lua than to Java or C.

  4. What is the difference between a regular string and a non-standard (prefixed) string literal in Julia?

    In Julia a regular double-quoted string like "hello" is processed by the standard String constructor with backslash escape sequences. A prefixed string such as r"\d+" または raw"C:\path" calls a non-standard string macro — r for regular expressions, raw for unescaped content, b for byte arrays, and many others including user-defined ones. Inside a non-standard literal the contents are passed verbatim, so backslashes are not consumed by the lexer. Triple-quoted variants ("""…""") span multiple lines and trim a common leading indentation.

広告なしで楽しみたいですか? 今すぐ広告なしで

拡張機能をインストールする

お気に入りのブラウザにIOツールを追加して、すぐにアクセスし、検索を高速化します。

に追加 Chrome拡張機能 に追加 エッジ拡張 に追加 Firefox 拡張機能 に追加 Opera 拡張機能

スコアボードが到着しました!

スコアボード ゲームを追跡する楽しい方法です。すべてのデータはブラウザに保存されます。さらに多くの機能がまもなく登場します!

ニュースコーナー 技術ハイライト付き

参加する

価値ある無料ツールの提供を継続するためにご協力ください

コーヒーを買って