2

I already know how to write Lexer and Parser。 If I want this programming language to communicate, how can I implement socket?

Deng Chord
  • 21
  • 2
  • You have to emit calls to system socket functions (`socket`, `connect`, `send`, `recv`, etc.) – arrowd Feb 18 '20 at 06:21
  • how to add system call for the language? – Deng Chord Feb 18 '20 at 06:24
  • 2
    You generate a [syscall or sysenter](https://stackoverflow.com/a/27714659/fnord) instruction with [the right arguments for that particular kernel-side function](https://blog.packagecloud.io/eng/2016/04/05/the-definitive-guide-to-linux-system-calls/#fast-system-calls). – arnt Feb 18 '20 at 08:06
  • It's very useful to me. Thank you. – Deng Chord Feb 19 '20 at 01:33

0 Answers0