current position:Home>After python, go also runs smoothly on the browser

After python, go also runs smoothly on the browser

2022-05-15 05:17:59Program ape DD_

writing | Director of the , Produce | OSC The open source community (ID:oschina2013)

Anaconda Developers recently released PyScript, This is a way for developers to HTML Mixed writing Python The framework of the code , Some people call it “Python edition JSP”. in fact ,PyScript The bottom layer uses WebAssembly, Because it's based on Pyodide structure ,Pyodide Compiled from WebAssembly Of CPython 3.8 The interpreter consists of , Allow to run... In a web browser Python.

f26753b11f62a0eb53c8f723c0fac7e6.png
picture

Similarly, , Developers use the same idea to make Go It also runs smoothly on the browser .https://goscript.dev The website supports running directly on the browser side Go Code , This is a Go playground, The underlying the Goscript, adopt WASM Realization .

e818032ab21d1ffcc4640356147166b0.png
picture

Goscript yes Go Unofficial implementation of language norms , be used for Rust The embedding or encapsulation of an item , Provides a simpler way to encapsulate and invoke the underlying Rust Code . It's like Lua To Redis/WoW, perhaps Python To NumPy.

Goscript It contains six items :

  • parser Turn the source code into AST, Transplanted from Go Official code .

  • type checker be based on AST Do type push down and type check , Also transplanted from Go Official code .

  • codegen be based on AST And type information to generate bytecode .

  • vm Run bytecode .

  • std The official library , Transplanted from Go The official library .

  • engine Including the official library native part , Plus simple packaging .

Goscript Realized Go Almost all the features of (pre 1.18, Therefore, generics are not included ), And transplanted some official Libraries , View relevant test cases that have passed https://github.com/oxfeeefeee/goscript/tree/master/engine/tests.

Goscript Project code :https://github.com/oxfeeefeee/goscript

We have created a high-quality technical exchange group , With good people , I will be excellent myself , hurriedly Click Add group , Enjoy growing up together . in addition , If you want to change jobs recently , Years ago, I spent 2 A wave of large factory classics were collected in a week , Those who are ready to change jobs after the festival can Click here to get

Recommended reading

··································

Hello , I'm a procedural ape DD,10 Old driver developed in 、 Alibaba cloud MVP、 Tencent cloud TVP、 I have published books and started a business 、 State-owned enterprises 4 In the Internet 6 year . From ordinary developers to architects 、 Then to the partner . Come all the way , My deepest feeling is that I must keep learning and pay attention to the frontier . As long as you can hold on , Think more 、 Don't complain 、 Do it frequently , It's easy to overtake on a curve ! therefore , Don't ask me what I'm doing now, whether it's in time . If you are optimistic about one thing , It must be persistence to see hope , Instead of sticking to it when you see hope . believe me , Just stick to it , You must be better than now ! If you don't have any direction , You can pay attention to me first , Some cutting-edge information is often shared here , Help you accumulate the capital to overtake on the curve .

Click to collect 2022 newest 10000T Learning materials

copyright notice
author[Program ape DD_],Please bring the original link to reprint, thank you.
https://en.pythonmana.com/2022/131/202205111244327724.html

Random recommended