Skip to main content

Vim Practice

· 2 min read
forfd8960
Author

Delete words backward

  • delete 1 word: db
  • delete n words: d<number>b

Delete word forward

  • dw: delete one word.

Change the current word inpalce

  • cw: chagne the current word

How to Customize your Own Error Type in Rust

· 2 min read
forfd8960
Author

Suppose you are writing a lexical analyzer(Lexer), and you want return some customized errors while the lexer scan tokens, and there are 3 possibel error will happens:

  • Not Supported Tokens.
  • Invalid Strings.
  • Invalid Nums.

SO you can define the errors with a rust enum:

pub enum LexerError {
InvalidToken(char),
InvalidString(String),
InvalidNum(String),
}

FullText Search Engine Componenets

· 2 min read
forfd8960
Author

What's the Core Components in a Full Text Search Engine

Look into Bleve Modern Search Lib Code, and Found that it has the following core components:

componentfunction of the component
analysismainly contains analyzer(char filters, token filters, tokenizer)
cmdcommand line client
documentdefine Document and Related Doc Fields(Text Field, Datetime Field, etc)
geoImplement geo point and geo shape query
indexAnalyze and read, write indexed fields to under key-value store
mappingimplment DocumentMapping: How the Document should be indexed.
searchImplment search functionality

How a Full Text Search engine works - Index

· 11 min read
forfd8960
Author

Recently I am start working on build a Full Text Search engine with rust. But I don't know how to get started. And have many questions:

  • What is the basic concept in the full-text search Engine.
  • What are the core conponents in the Engine.
  • And how they works together.
  • How the document/text is analyzed and filtered,
  • How the analyzed indexed is stored on the disk.
  • How the engine searchs the results according user's query.

After Read about Elastic Search Docuemnts, Melisearch blogs, Couchbase blog, and read some source code from Bleve.

Comapre Rust with Golang

· 4 min read
forfd8960
Author

I have been using golang long time to wirte backend business logic.

After writing some rust code and I want do a comparison between golang and rust. This is maybe another good way to help you learn rust.

Build A Simple Interpreter with Rust Part0

· 2 min read
forfd8960
Author

What is Interpreter

From Wikipedia:

In computer science, an interpreter is a computer program that directly executes instructions written in a programming or scripting language, without requiring them previously to have been compiled into a machine language program. An interpreter generally uses one of the following strategies for program execution:

  1. Parse the source code and perform its behavior directly;
  2. Translate source code into some efficient intermediate representation or object code and immediately execute that;
  3. Explicitly execute stored precompiled bytecode made by a compiler and matched with the interpreter Virtual Machine.

Welcome

· One min read
forfd8960
Author

Buildwithrs.dev is the blog site that to record the process of building things from scratch with Rust Programming language.