emcc,wasm,webassembly
WASM:
https://github.com/Hanks10100/wasm-examples/tree/master/simple
mkdir hello
cd hello
echo '#include <stdio.h>' > hello.c
echo 'int main(int argc, char ** argv) {' >> hello.c
echo 'printf("Hello, world!\n");' >> hello.c
echo '}' >> hello.c
emcc hello.c -s WASM=1 -o hello.html
printf '#include<iostream> \nint main() { std::cout<<"hello world"<<std::endl; return 0;}' > helloworld.cpp
docker run --rm -v $(pwd):/src trzeci/emscripten emcc helloworld.cpp -o helloworld.html
docker run --rm -v $(pwd):/src trzeci/emscripten emcc math.c -Os -s WASM=1 -s SIDE_MODULE=1 -o math.wasm
python3 -m http.server 8080 #此时打开localhost:8080即可看到相应页面
emcc math.c -Os -s WASM=1 -s SIDE_MODULE=1 -o math.wasm
https://github.com/Hanks10100/wasm-examples
https://blog.csdn.net/liuyan19891230/article/details/79144332
https://segmentfault.com/a/1190000008402872
emcc,wasm,webassembly的更多相关文章
- 如何生成WebAssembly文件?
许多3D游戏都是用C/C++语言写的,如果能将C/C++语言编译成JavaScript代码,它们不就能在浏览器里运行了吗?Emscripten的底层是LLVM编译器,Emscripten可以将c/c+ ...
- WASM
WASM WebAssembly https://webassembly.org/ https://github.com/appcypher/awesome-wasm-langs https://me ...
- 在kubernetes上运行WASM负载
在kubernetes上运行WASM负载 WASM一般用在前端业务中,但目前有扩展到后端服务的趋势.本文使用Krustlet 将WASM服务部署到kubernetes. 简介 Krustlet 是一个 ...
- WebAssembly正逐渐成为FaaS的主力
相信很多人都知道PaaS(平台即服务)和IaaS(基础设施即服务).而随着云计算时代的发展,逐渐出现了大量的XaaS形式的概念,这些技术从原先的硬件服务器,虚拟化服务,再到容器化逐渐转变.使得软件发布 ...
- 试试将.NET7编译为WASM并在Docker上运行
之前有听到说Docker支持Wasmtime了,刚好.NET7也支持WASM,就带大家来了解一下这个东西,顺便试试它怎么样. 因为WASM(WebAssembly) 一开始是一个给浏览器的技术,比起J ...
- shell 中长命令的换行处理
考察下面的脚本: emcc -o ./dist/test.html --shell-file ./tmp.html --source-map-base dist -O3 -g4 --source-ma ...
- Linux 一条长命令占用多行
前言 考察下面的脚本: ? 1 emcc -o ./dist/test.html --shell-file ./tmp.html --source-map-base dist -O3 -g4 --so ...
- Istio中的流量配置
Istio中的流量配置 目录 Istio中的流量配置 Istio注入的容器 Istio-init istio-proxy Envoy架构 Pilot-agent生成的初始配置文件 Envoy管理接口获 ...
- 【一月一本技术书】-【Go语言设计与实现】- 9月
Go : 2009.11.10 代表作:Docker.k8s.etcd 模仿C语言,目标:互联网的C语言 讲的晦涩难懂....硬板..放弃了好几次才读完.满分10分,打6分. 下个月:Python数据 ...
随机推荐
- atitit r9 doc on home ntpc .docx
卷 p2soft 的文件夹 PATH 列表 卷序列号为 9AD0-D3C8 D:. │ Aittit pato 面对拒绝 的回应.docx │ Atitit 中国明星数量统计 attilax. ...
- Why does deep learning work?
Learning Deep Architectures for AI By Yoshua Bengio http://www.iro.umontreal.ca/~bengioy/papers/ftml ...
- vue2.0 项目搭建 和vue 2.0 electron 项目搭建
1.关于electron vue 项目的搭建 全局或者局部安装项目vue: 脚手架指令生成: npm install -g vue-cli vue init simulatedgreg/electro ...
- css世界的学习笔记
1.+选择器div+p:选择紧接在div后的所有p元素: 2.导航的样式:(注意:不给a设置width:100%;只是需要display:block;利用流布居:) <h4>无宽度,借助流 ...
- TensorFlow 图片resize方法
参见这篇博客 tensorflow里面用于改变图像大小的函数是tf.image.resize_images(image, (w, h), method):image表示需要改变此存的图像,第二个参数改 ...
- 【网络编程】——Lighttpd 返回HTTP/1.1 417 Expectation Failed
最近在使用python 的 pcurl 发送 post 请求到服务端的时候[服务端使用的服务是Lighttpd],发现只要 post 请求的数据超过 1024 之后,就会返回如下错误: * Hostn ...
- mvc webapi路由重写
修改app_start/webapiconfig.cs using System.Web.Http; using System.Web.Routing; using Ninject; using Tx ...
- Java 判断字符串 中文是否为乱码
import java.util.regex.Matcher; import java.util.regex.Pattern; public class ChineseUtill { private ...
- Golang遇到的一些问题总结
当类成员是struct指针.map.slice 时,默认初始化的值是 nil,在使用前需要提前初始化,否则会报相关的 nil 错误.引用类型的成员,默认会初始化为 nil,但对 nil 的切片进行 l ...
- MySQL加密解密
1. 加密:mysql323,不可逆 select old_password('bbs.antian365.com'); # 10c886615b135b38 2. 加密:mysqlsha1,不可逆 ...