2017???????JavaScript??????????
???????????? ???????[ 2017/4/13 13:28:40 ] ????????Javascript ???????????
????2017???????JavaScript???????????????????Web ??????????????????????2016-???????·:???????????????????2016????????????????????????????????????????????Щ???????
????????????????Щ??????????????????????????????????????????????????????????????????????????????????????????????????????????????????磬?????????????????б???????
?????????????Dan Abramov??Twitter?????????????
????JS??????????????????????????????????????????????????????????Twitter?????????????ж???????С????????δ?????С?????????????????????????????????????????????
????WebAssembly
???????????????????WebAssembly???????WebAssembly??????Web??????????????????????????????????????????е?Web????????????????????????????????????????????????????????JavaScript??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????JavaScript????????????????????????????????????????WebAssembly??????????У???????????Σ???????????????к??????????????????????????????WebAssembly?????????????????????δ????JavaScript??????????????????WebAssembly????????????????Eric Elliott?????????
????Elm
???????????????????Elm?????????????????н?????
????2016?????????????Elm??????У?Elm????????JavaScript??????????????????????JavaScript??????????????????????????????????????????????ο?Elm ????????Elm?????????????
????· ?????????????????????null?????undefined is not a funtion??
????· ?????????????????????????????
????· ??????????淶??????????????????????????????????????????????
????· ???????е?Elm?????????汾??????
????????????Elm????????????????????д??????????????????????????Elm????????JavaScript???????JavaScript???????????????1????????????
????babili(babel-minify)
????Babili????2016??8?·?????????????Babel???????????????ES6????????????Henry Zhu??????????г????????????????????????????????????£?
????????????????????
??????????ES5???????????????????????????Babili?????????????ES2015+????????????????????????????????????????????ES2015????????????????????????????????Babili????????Babel preset???????е?Babel?????У?????????????????????й????
????????????????????????д?????μ?ES6??:
????class Mangler {
????constructor(program) {
????this.program = program;
????}
????}
????// need this since otherwise Mangler isn't used
????new Mangler();
????????????????Babel???б?????????????????′???:
????// ES2015 code -> Babel -> Uglify/Babili -> Minified ES5 Code
????var a=function a(b){_classCallCheck(this??a)??this.program=b};a();
??????Babili??Ч??????:
????// ES2015 code -> Babili -> Minified ES2015 Code
????class a{constructor(b){this.program=b}}new a;
????OCaml
????OCaml?????JS????????????б?????????????????OCaml???????????????????????????????????????????????·???????????Haskell??????????OCaml???????S??????????????????????Haskell??Facebook?????????????OCaml???????????Hack??Flow???Infer???????OCaml???????
????BuckleScript
????BuckleScript?????OCaml??????????????Bloomberg???????????Duane Johnson?????????????£?
????BuckleScript????bsc?????????OCaml?????????????μ?JavaScript??????????????????????????????????????OCaml?????????????????????npm??????????Web???????
??????????????????BuckleScript???????????BuckleScript???????????
let port = 3000
let hostname = "127.0.0.1"
let create_server http =
let server = http##createServer begin fun [@bs] req resp ->
resp##statusCode #= 200;
resp##setHeader "Content-Type" "text/plain";
resp##_end "Hello world
"
end
in
server##listen port hostname begin fun [@bs] () ->
Js.log ("Server running at http://"^ hostname ^ ":" ^ Pervasives.string_of_int port ^ "/")
end
let () = create_server Http_types.http
????????????:
'use strict';
var Pervasives = require("bs-platform/lib/js/pervasives");
var Http = require("http");
var hostname = "127.0.0.1";
function create_server(http) {
var server = http.createServer(function (_?? resp) {
resp.statusCode = 200;
resp.setHeader("Content-Type"?? "text/plain");
return resp.end("Hello world
");
});
return server.listen(3000?? hostname?? function () {
console.log("Server running at http://" + (hostname + (":" + (Pervasives.string_of_int(3000) + "/"))));
return /* () */0;
});
}
create_server(Http);
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11