• 2024-06-04Elixir学习笔记——第一章
    本指南将向您介绍Elixir基础知识-语言语法、如何定义模块、语言中的常见数据结构等。本章将重点介绍如何确保安装了Elixir,以及您可以成功运行Elixir的交互式Shell(称为IEx)。安装如果您尚未安装Elixir,请访问我们的安装页面。完成后,您可以运行elixir--version以获
  • 2024-04-08(译) 理解 Elixir 中的宏 Macro, 第六部分:原地代码生成
    ElixirMacros系列文章译文[1](译)UnderstandingElixirMacros,Part1Basics[2](译)UnderstandingElixirMacros,Part2-MacroTheory[3](译)UnderstandingElixirMacros,Part3-GettingintotheAST[4](译)UnderstandingElixirMacros,Part4-Div
  • 2024-04-08(译) 理解 Elixir 中的宏 Macro, 第五部分:组装 AST
    ElixirMacros系列文章译文[1](译)UnderstandingElixirMacros,Part1Basics[2](译)UnderstandingElixirMacros,Part2-MacroTheory[3](译)UnderstandingElixirMacros,Part3-GettingintotheAST[4](译)UnderstandingElixirMacros,Part4-Div
  • 2024-04-03(译) 理解 Elixir 中的宏 Macro, 第四部分:深入化
    ElixirMacros系列文章译文[1](译)UnderstandingElixirMacros,Part1Basics[2](译)UnderstandingElixirMacros,Part2-MacroTheory[3](译)UnderstandingElixirMacros,Part3-GettingintotheAST[4](译)UnderstandingElixirMacros,Part4-Div
  • 2024-04-03(译) 理解 Elixir 中的宏 Macro, 第三部分:深入理解 AST
    ElixirMacros系列文章译文[1](译)UnderstandingElixirMacros,Part1Basics[2](译)UnderstandingElixirMacros,Part2-MacroTheory[3](译)UnderstandingElixirMacros,Part3-GettingintotheAST[4](译)UnderstandingElixirMacros,Part4-Div
  • 2024-04-01(译) 理解 Elixir 中的宏 Macro, 第二部分:宏理论
    ElixirMacros系列文章译文[1](译)UnderstandingElixirMacros,Part1Basics[2](译)UnderstandingElixirMacros,Part2-MicroTheory[3](译)UnderstandingElixirMacros,Part3-GettingintotheAST[4](译)UnderstandingElixirMacros,Part4-Div
  • 2024-01-18nerves 基于elixir 开发嵌入式系统
    nerves可以使我们基于elixir开发嵌入式系统,而且基于erlang强大的虚拟机能力实现可靠,高效的系统说明nerves包含了不少子系统,都可以加速系统的开发,值得学习下参考资料https://nerves-project.org/#featureshttps://github.com/grisp/grisphttps://erlangsolutions.medium.com/iot
  • 2024-01-16cachex elixir 强大的缓存框架
    cachex是一个强大的elixircache库,提供了事务,fallback,以及过期等基本能力包含的特性TTL最大大小限制pre、post执行hooks事务以及row锁异步写操作分布式同步本地文件系统streamingcache批量写用户命令调用统计信息参考使用分布式模式对于测试需要配置sname
  • 2024-01-15elixir before_compile && on_definition 简单使用
    elixir提供了一些方便的模块属性,可以让我们方便的进行elixir的扩展(尤其是进行元编程的时候)比如elixir_agent就使用到了before_compile以及on_definition,方便进行trace的处理on_definition的简单使用参考demo内容来自官方,可以实现输出函数的一些信息 defm
  • 2024-01-09oban elixir 强大的任务处理框架
    obanelixir强大的任务处理框架,后端存储基于了sqlite或者pg包含的特性IsolatedQueuesQueueControlResilientQueuesJobCancelingTriggeredExecutionUniqueJobsScheduledJobsPeriodic(CRON)JobsJobPriorityHistoricMetricsNodeMetricsGracefulShutdownTelemetryInteg
  • 2024-01-08elixir erlang 简单调用学习
    实际上基于elixir的mix进行erlang以及elixir的互调用开发处理是很方便的,mix直接就包含了构建erlang代码同时对于代码的互调用,只要使用符合语言格式要求就行了,以下是一个简单的互调用学习项目准备项目结构 ├──README.md├──lib│├──a.ex│└──er_app
  • 2024-01-08elixir mix observer 工具的使用
    默认elixirmix没有添加observer工具的依赖直接运行会提示找不到方法解决方法添加几个额外的依赖主要是observer,:wx,:runtime_tools这几个 defapplicationdo[extra_applications:[:logger,:observer,:wx,:runtime_tools]]end说明注意可能不同版本elixi
  • 2024-01-08elixir config 简单说明
    elixir的config模块,实际上就是标准的方法,只是mix项目中在使用的时候使用了dsl模式的,没有使用包含括号的模式调用给人一种似乎觉得有点怪的调用模式参考代码只说明config方法,实际上Config模块还包含了其他方法mix中的调用 importConfigconfig:ecto_demo,Dalong.App,
  • 2024-01-08elixir mix 自定义任务
    elixir的mix比较灵活,同时也比较强大,很多时候我们可以自己定义一个任务,方便运行以及构建,不少三方框架会提供一些方便的cli,一般也会使用此方法比如ectoorm框架,以下是一个简单的自定义task学习参考开发目录位置这个实际上都f放那里可以,只是有一个简单的约定,建议放到lib/mix/
  • 2024-01-08elixir 模块名一些参考资料
    elixir的模块名实际上是一个atom类型的数据,以下是一些参考资料参考使用比如一个mixsup项目defmoduleEctoDemo.ApplicationdouseApplication@impltruedefstart(_type,_args)dochildren=[]#此处name实际上就是使用了模块名格式的,因为是
  • 2024-01-08elixir defdelegate 使用
    delegate模式,在不少语言都支持,有些是隐式的(一些早期语言),有些是显式的(新语言,kotlin,swift等)elixir也支持delegate处理,还是比较方便的,以下是一个简单的使用定义原始方法default.ex defmoduleDefaultdodeflogin(name,password)doIO.puts"fromDefault.login"
  • 2024-01-08absinthe elixir 的graphql 框架简单试用
    absintheelixir的graphql框架包含的特性graphql草案的完整实现插件化设计异步字段解析以及批量解析,同时支持插件化的解析支持安全包含了基于GraphiQL的playground项目测试基于了phoenix框架创建phoenix项目mixphx.newabsinthe_phx添加sqliteecto依赖默认phoenix使用了
  • 2024-01-08elixir apply 结合 macro 一个方便的开发技巧
    此玩法实际在Phoenixelixir项目中使用比较多,以下是一个简单的示例示例代码login.exdefmoduleLogindodefdemoappdoquotedoimportunquote(__MODULE__)endenddefdalongdoIO.puts("dalongdemo")enddefmacro__using__(which)whenis_
  • 2024-01-08elixir macro defoverridable 功能
    基于macro的包装函数可以使用defoverridable可以方便进行方法的重写参考使用app.exdefmoduleAppdodefmacro__using__(_options)doquotedodefinitdoIO.puts"doinit"enddeflogindoIO.puts"dologin"end
  • 2024-01-08wasmex webassenbly elixir 运行时
    wasmex是基于wasmtime以及rustnif开发的方便elixir运行webassembly的框架与rust的集成与rust集成使用的三方包 与mjml工具类似使用了rustler_precompiled以及rustlerrust使用的三方包 前边也说了是基于了wasmtime包装的,同时使用了wasmtimewasi一些子模块说明rustle
  • 2024-01-05elixir erlang 简单调用学习
    实际上基于elixir的mix进行erlang以及elixir的互调用开发处理是很方便的,mix直接就包含了构建erlang代码同时对于代码的互调用,只要使用符合语言格式要求就行了,以下是一个简单的互调用学习项目准备项目结构 ├──README.md├──lib│├──a.e
  • 2024-01-03rebar3 集成elixir 模块
    社区包含了一个rebar3的elixirmix插件,可以方便rebar使用elixir模块参考使用rebar.config配置{erl_opts,[debug_info]}.{deps,[%添加引用{decimal,"2.0.0"}]}.{shell,[{apps,[basic]}]}.%添加插件{plugins,[rebar_mix]}.{provider_hooks,[{
  • 2024-01-03elixir mjml_nif 试用
    mjml_nif是使用rustler包装的mrml基于了erlang的nif接口实现的elixir模块,同时为了方便预编译nif的使用,使用了rustler_precompiled,以下是一个简单的试用项目试用添加依赖defpdepsdo[{:mjml,"~>3.0"}]end代码集成lib/mail/rong.mail.exdefmoduleRo
  • 2023-12-28elixir mjml_nif 试用
    mjml_nif是使用rustler包装的mrml基于了erlang的nif接口实现的elixir模块,同时为了方便预编译nif的使用,使用了rustler_precompiled,以下是一个简单的试用项目试用添加依赖 defpdepsdo[{:mjml,"~>3.0"}]end代码集
  • 2023-12-27rebar3 引用本地elixir 模块
    前边简单说过基于rebar_mix使用elixir模块,但是使用的模块是三方的,如果时候我们可以需要使用自己的就可以使用本地git项目,或者搭建自己的私服git,以下是一个简单使用项目准备本地elixirmix项目一个基于mixcli创建的项目,同时进行gitinit mixnewlogingit