ValarMorghulis.IO
open-menu closeme
Home
Tech
View
twitter github rss
  • Python version of Rust Result Sum Type

    calendar Jan 19, 2025 · 1 min read · python sum type rust  ·
    Share on: twitter facebook linkedin copy

    I try to implement a Python version of the Result<T, E> sum type in rust which can be used with match/case pattern matching. The pattern matching with sub-patterns like case Err(e) could be implemented in Python with the match_args dunder attribute. This is how Result[T, E], OK() and Err() defined: 1import typing 2 …


    Read More
  • Run wasm built with wasm-pack with pythonmonkey

    calendar Jan 3, 2025 · 2 min read · python wasm rust  ·
    Share on: twitter facebook linkedin copy

    I have been trying to run wasm code built with wasm-pack with pythonmonkey, a Mozilla SpiderMonkey JavaScript engine embedded into the Python Runtime. Consider a lib.rs as follow: 1use wasm_bindgen::prelude::*; 2 3#[wasm_bindgen] 4pub fn add(a: i32, b: i32) -> i32 { 5 return a + b; 6} With wasm-pack, we can build the …


    Read More

valarmorghulis.io

Programming / Thinking / Writing / Reading

Recent Posts

  • Python dependencies states managed via uv(illustrated)
  • Deploy models on SGLang with CPU only
  • Run MiniCPM4 with CPU only
  • Call MCP Server(stdio) directly in the shell
  • Measuring the CPU and Memory Usage for Python subprocess
  • tac -- the ignored reverse of cat
  • Python version of Rust Result Sum Type
  • Run wasm built with wasm-pack with pythonmonkey

Categories

SOFTWARE ENGINEERING 1 SOFTWARE INDUSTRY 1 TECHNIQUE 1

Tags

PYTHON 13 AI 3 DOCKER 2 RUST 2 ASYNCIO 1 AWS 1 BASH 1 BOT 1 CLIPBOARD 1 EXCEL 1 FLASK 1 HTTP 1 MARAIDB 1 MCP 1
All Tags
AI3 ASYNCIO1 AWS1 BASH1 BOT1 CLIPBOARD1 DOCKER2 EXCEL1 FLASK1 HTTP1 MARAIDB1 MCP1 MESOP1 MONGODB1 MSYQL1 MYSQL1 NEXTJS1 PM21 POSTGRES1 POWERSHELL1 PYDANTIC1 PYTHON13 ROBOTS.TXT1 RUST2 SSL1 SUM TYPE1 UV1 WASM1 WSL1
[A~Z][0~9]
valarmorghulis.io

Copyright 2016- 2025 VALARMORGHULIS.IO . All Rights Reserved

to-top