sudo dnf install glibc-static
cd libjit可是 libc 不知为何无法静态链接.... 😶
./bootstrap
make
sudo make install
pushd tutorial
clang -o test t1.c -ljit
popd
https://t.me/dsuses/2280
Telegram
duangsues.is_a? SaltedFish
#include <stdio.h>
#include <jit/jit.h>
jit_context_t context;
int main(int argc, char **argv)
{
jit_type_t params[3];
jit_type_t signature;
jit_function_t function;
jit_value_t x, y, z;
jit_value_t temp1, temp2;
jit_int arg1,…
#include <jit/jit.h>
jit_context_t context;
int main(int argc, char **argv)
{
jit_type_t params[3];
jit_type_t signature;
jit_function_t function;
jit_value_t x, y, z;
jit_value_t temp1, temp2;
jit_int arg1,…
那为什么说我是“逆流而上“呢?#life #recommended #blog
很明显,在大家都疯了一般在学校里参加各种模拟测试时,我回家自学;在大家都去网吧,打游戏,谈恋爱,追电视剧时,我在写程序;大家都在参加各种比赛拿证的时候,我在社团泡着写程序;大家都在使用成熟框架写程序时,我不厌烦的去尝试自己实现基础功能。我看起来是最傻,最Low的那个臭屌丝,整天沉迷于好像没什么用的程序里,最后却比大多数嘲笑我的人跳的更高。
那为什么逆流的人很少能攀的更高呢?
逆流是一个非常危险的行为,如果把控不好方向很容易走歪。都听说过“博观而约取,厚积而薄发“,却很少有人懂得其本质。现在的人都太浮躁,被大量的毒鸡汤洗脑,希望能一夜成名。尤其是我们的同龄人和后辈,被现在一些不良之风带坏,梦想通过当网红打电竞一夜暴富,过上衣食无忧的生活;或者希望几年,几个月,甚至几周就精通一门专业技术,快速实现自己不切实际的梦想。无论是什么事,没有厚积,哪来的薄发!如果怀揣梦想,一定要脚踏实地的一步一个脚印去实现它,戒骄戒躁,才能有机会去实现它。
最后,任何一个人的成长道路都不是完全相同的,一定要结合自己的实际情况,选择适合自己的道路,并坚定的走下去。我相信任何人都能够逆流而上,活出自己的精彩。
"
谨以此文,纪念我18年的成长历程,送给我的学生,我的学弟学妹,我的后辈以及我自己,希望能够给更多的人启发而走出自己的道路。"来源请求?
另外 duangsuse 之前默写了一些语言名称 #PL #life
Lua C C++ C# Objective-C F# VisualC VisualBasic Basic JavaScript ActionScript Ruby Python Matlab Wolfram Octave Julia Java Kotlin Scala Clojure VHDL Prolog Algor96 Fortran Go
Perl Rust Swift Ada SmallTalk Logo Turtle Crystal Elvish EmacsLisp CommonLisp ChezScheme Racket Haskell Erlang Elixir Idris Dart COBOL Red
Tcl TypeScript RubyMotion Agda PHP REBOL Pascal Coq D OCaml ML Vala Squirrel GDScript
Lua C C++ C# Objective-C F# VisualC VisualBasic Basic JavaScript ActionScript Ruby Python Matlab Wolfram Octave Julia Java Kotlin Scala Clojure VHDL Prolog Algor96 Fortran Go
Perl Rust Swift Ada SmallTalk Logo Turtle Crystal Elvish EmacsLisp CommonLisp ChezScheme Racket Haskell Erlang Elixir Idris Dart COBOL Red
Tcl TypeScript RubyMotion Agda PHP REBOL Pascal Coq D OCaml ML Vala Squirrel GDScript
Forwarded from duangsuse Throws
; MoudleID = 'autumn.ll' 中秋节快乐!
source_filename = "autumn.ll"
@autumn = private constant [10 x i8] c"中秋节\00"
@happy = private constant [11 x i8] c"快乐!\0a\00"
; Function Attrs: noinline nounwind optnone
define i32 @main(i32 %argc, i8** %argv) #0 {
call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @autumn, i32 0, i32 0))
call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @happy, i32 0, i32 0))
call void @exit(i32 0)
unreachable
}
attributes #0 = { noinline nounwind optnone uwtable }
attributes #1 = { noreturn }
declare i32 @printf(i8*, ...)
; Function Attrs: noreturn
declare void @exit(i32) #1
(🙈 假装把这个当成自己的中秋节祝福
中秋节快乐哦,阖家团圆,幸福美满 🌕🍰
#bash #recommended 233333 #haha #tech
https://github.com/benrady/shinatra/blob/master/shinatra.sh
https://github.com/benrady/shinatra/blob/master/shinatra.sh
#!/usr/bin/env bash
RESPONSE="HTTP/1.1 200 OK\r\nConnection: keep-alive\r\n\r\n${2:-"OK"}\r\n"
while { echo -en "$RESPONSE"; } | nc -l "${1:-8080}"; do
echo "================================================"
done
GitHub
benrady/shinatra
A simple web server in 5 lines of bash. Contribute to benrady/shinatra development by creating an account on GitHub.
duangsuse 买的 《Lua 设计与实现》还是 5.1 时代,之前也没听说过,大概是和 ES6 的修改一样吧,同样位长现在允许 number 和 double 同时使用
不用怕损失精度、溢出什么的了 #lua #PL
Androlua+ 虽然 port 了个 Lua5.3 的过去,但是实际上很多特性没有专门介绍(反正讲了很多人也懒得学),包括 number 细化区分
https://www.lua.org/manual/5.3/manual.html#2
There are eight basic types in Lua: nil, boolean, number, string, function, userdata, thread, and table.
The type nil has one single value, nil, whose main property is to be different from any other value; it usually represents the absence of a useful value.
The type boolean has two values, false and true. Both nil and false make a condition false; any other value makes it true.
The type number represents both integer numbers and real (floating-point) numbers.
The type string represents immutable sequences of bytes. Lua is 8-bit clean: strings can contain any 8-bit value, including embedded zeros ('\0'). Lua is also encoding-agnostic; it makes no assumptions about the contents of a string.
The type number uses two internal representations, or two subtypes, one called integer and the other called float.
Lua has explicit rules about when each representation is used, but it also converts between them automatically as needed (see §3.4.3).
Therefore, the programmer may choose to mostly ignore the difference between integers and floats or to assume complete control over the representation of each number.
Standard Lua uses 64-bit integers and double-precision (64-bit) floats, but you can also compile Lua so that it uses 32-bit integers and/or single-precision (32-bit) floats. The option with 32 bits for both integers and floats is particularly attractive for small machines and embedded systems. (See macro LUA_32BITS in file luaconf.h.)
不用怕损失精度、溢出什么的了 #lua #PL
Androlua+ 虽然 port 了个 Lua5.3 的过去,但是实际上很多特性没有专门介绍(反正讲了很多人也懒得学),包括 number 细化区分
https://www.lua.org/manual/5.3/manual.html#2
There are eight basic types in Lua: nil, boolean, number, string, function, userdata, thread, and table.
The type nil has one single value, nil, whose main property is to be different from any other value; it usually represents the absence of a useful value.
The type boolean has two values, false and true. Both nil and false make a condition false; any other value makes it true.
The type number represents both integer numbers and real (floating-point) numbers.
The type string represents immutable sequences of bytes. Lua is 8-bit clean: strings can contain any 8-bit value, including embedded zeros ('\0'). Lua is also encoding-agnostic; it makes no assumptions about the contents of a string.
The type number uses two internal representations, or two subtypes, one called integer and the other called float.
Lua has explicit rules about when each representation is used, but it also converts between them automatically as needed (see §3.4.3).
Therefore, the programmer may choose to mostly ignore the difference between integers and floats or to assume complete control over the representation of each number.
Standard Lua uses 64-bit integers and double-precision (64-bit) floats, but you can also compile Lua so that it uses 32-bit integers and/or single-precision (32-bit) floats. The option with 32 bits for both integers and floats is particularly attractive for small machines and embedded systems. (See macro LUA_32BITS in file luaconf.h.)
此外,Lua 5.3 还加入了位运算特性,也是一个值得注意的部分(貌似 5.2 就有)
Lua 作为嵌入式辅助语言是非常缺少高性能实现啊... 😶
Lua 作为嵌入式辅助语言是非常缺少高性能实现啊... 😶