Re: What do you think about Redox and Electron?

2017-01-19 Thread _tulayang
@Libman There is no point in what you say. You never volunteer your time to do anything. @Araq Now, waste your rights! I've seen a narrow minded team living in a Utopia. Bye bye! Hope you never use the JavaScript language and libuv.

Re: What do you think about Redox and Electron?

2017-01-19 Thread _tulayang
@Araq > I'm having enough of this now. Disagreeing is not "not understanding". One should always base one's opinion on facts rather than write hundreds of lines of code. You said you know the JS language well. Have you ever used one of the following tools: TypeScript or Babel, Webpack,

Re: What do you think about Redox and Electron?

2017-01-19 Thread _tulayang
@Libman > I think TypeScript is uglier than Nim, and it is objectively more verbose. When I recommended Nim language to other people, they say they hate indentation. Don't be conceited. > This forum was written in Nim. Its source is more readable than anything in > NodeJS, and its performance

Re: What do you think about Redox and Electron?

2017-01-18 Thread _tulayang
@dom96 @Araq You designed a handy language and compiler. But I think you're too concerned about yourself (the core Nim compiler team). This thread is created for all the enthusiasts of Nim-lang in this forum. I never thought the core team could build these huge systems. Putting these things

Re: What do you think about Redox and Electron?

2017-01-16 Thread _tulayang
@Krux02 You said your opinion, and I said mine. If you still have any intelligent opinion, tell it. I listed some popular excellence systems currently. Microsoft, Linux foundation, Google Cloud, Intel and etc are all working for them. Then, somebody thought HTML, JS, and ... are so crap, and

Re: What do you think about Redox and Electron?

2017-01-16 Thread _tulayang
> Electron is further piling on top of the Web browser stack, which has always > been and will always be crap... HTML is crap, JS is crap, IndexedDB is crap, > etc - and anything built on top of them is crap by default. But, hey - at > least it's a dominant open standard, so it could be worse

Re: What do you think about Redox and Electron?

2017-01-16 Thread _tulayang
@Libman I don't think so. In the future Google's ChromeOS will be a succeful OS (We know they're working on it): * focusing on app * easy to install * cheap to operate * looks beautiful * seamless connection to the network Electron is not a simple adhesive, but a careful design: >

Re: What do you think about Redox and Electron?

2017-01-14 Thread _tulayang
> Hiding complexity does not remove complexity. It just gives you the illusion > that things are simpler, when they are not. Do you really understand the (gtk, winform) system when you develop an application using GTK or winform? No, you don't unless you are a core member of GTK / winform. In

Re: What do you think about Redox and Electron?

2017-01-13 Thread _tulayang
@Krux02 You should really look at [Zephry JavaScript](https://www.zephyrproject.org/community/blog/introducing-javascript-runtime-zephyr-os) \--- "JavaScript* is one of the most widely used programming languages today, and in recent years has jumped from its origins on desktop web browsers to

Re: collections.nim and reactor.nim v0.3.0 released

2017-01-11 Thread _tulayang
@dom96 By the way, I think event-driven models are useful for plug-in programming. How about adding events to asyncdispath and asynchttpserver? Such as : proc handleError() {.async.} = await sleepAsync(1000) echo "handleError" proc handleRequest(req) {.async.}

Re: SIGSEGV when trying to define generic procedure

2016-09-19 Thread _tulayang
I thought: # proc # --> stack in for i in 0..high(lhs) : result[i] = lhs[i] + rhs[i] # --> stack out # # --> nil So, ...

Re: What does

2016-09-19 Thread _tulayang
In my opinion, "direct hardware access in Nim" means File System API, Socket API written by C. There are equivalent wrappers in Python (written by C and wrappered by Python). If you want to write some "direct hardware access" low-level API, you should comply with the specification of these C

Re: Any new roadmap for 1.0 coming?

2016-09-19 Thread _tulayang
any information?

Re: Nim running Lua calling Nim

2016-09-11 Thread _tulayang
Why not use IPC?

Re: The cstring type and interfacing with the backend.

2016-09-01 Thread _tulayang
I really really don't want to hear about anything about GO. GO is a failure language, OK?

Re: How to keep an authorized connection session?

2016-09-01 Thread _tulayang
You should write a session API on server with some key-value cache database (such as redis). Then using cookie to transform session state between client and server. Cookie: sid=0123456abcdefg Session API client

Re: programming ligatures

2016-08-31 Thread _tulayang
So beautiful!

Re: async I/O API: why strings?

2016-08-31 Thread _tulayang
If Salvatore Sanfilippo or somebody want to write another redis by Nim, then what facilities does the libs offer? Does Nim just focuse on the application layer softwares? Just another Java without VM?

Re: async I/O API: why strings?

2016-08-30 Thread _tulayang
@dom96 I'd like to suggest to provide both low level pointer and high level string. recv(socket, pointer, size) send(socket, pointer, size) specially --- just like c socket: common, flexible, efficient.

Re: reactor.nim 0.0.1 - an asynchronous networking library - is released

2016-08-29 Thread _tulayang
Good job. I didn't see TCP/UDP/HTTP Servers. Are you still developing them?

Re: asynchttpserver and big request body

2016-08-25 Thread _tulayang
@vega I think it is different between io of httpserver and stand stream. readChar readData ... are not useful. I think we need apis like recvOnClientError recvOnAChunk recvOn100Continue recvOnTimeout etc.

Re: asynchttpserver and big request body

2016-08-25 Thread _tulayang
Suggest to export the data received at each time, so that users can use this api to customize how their datas are stored (copy to their buffer or disk files).

Re: Strange GC problem ?

2016-08-23 Thread _tulayang
It's not a bug in GC. ref array could not allocate memory from heap. ref array is a bad represent.

Re: Strange GC problem ?

2016-08-23 Thread _tulayang
Try: type Vector = ref object value: array[2, float64] Matrix = ref object value: array[2, Vector] IX = range[0..1] proc newVector(): Vector = new(result) proc newMatrix(): Matrix = new(result) for ix

Re: Reading large files using Nim

2016-08-16 Thread _tulayang
You just need **8192 B** (64 bit CPU) for you large files. Whenever you actually does not need all 16GB data. Try: import os, posix const BufSize = 8192 filename = "/home/king/test.txt" var pos = 0 size = 0 f: File buf:

Re: how to use Natural type?

2016-08-15 Thread _tulayang
I think this will be useful when you try to write an api about database. Natural (it mean >= 0) can represents primary key of mysql, and so on ...

Re: Going to Haxe. Nim In Action book available.

2016-08-15 Thread _tulayang
@wulfklaue Oh! ECMAScript2015, ECMAScript7 and nodejs are very popular now. I think you just not understand JavaScript. You should have a look at: import fs from "fs"; const stateNone = 0; const stateRead = 1; const stateWrite = 2; class IO {

Re: Can't build asyncnet example on macosx

2016-08-15 Thread _tulayang
@OderWat Don't mind.

Re: Can't build asyncnet example on macosx

2016-08-14 Thread _tulayang
不过我还是建议你用 {.async.} , 省不少事情,性能其实损失不了多少: import asyncnet, asyncdispatch proc recvAll(sock: AsyncSocket) {.async.} = for i in 0 .. 50: var ret = await recv(sock, 10) echo("Read ", ret.len, ": ", ret.repr) proc main() {.async.} = var sock =

Re: Can't build asyncnet example on macosx

2016-08-14 Thread _tulayang
OO! 我加了个 {.gcsafe.} 可以通过了: import asyncnet, asyncdispatch var sock = newAsyncSocket() var f = connect(sock, "irc.freenode.net", Port(6667)) f.callback = proc (future: Future[void]) {.gcsafe.} = echo("Connected in future!") echo repr sock

Re: Can't build asyncnet example on macosx

2016-08-13 Thread _tulayang
这样才是正确的: import asyncnet, asyncdispatch var sock = newAsyncSocket() proc onConnect(sock: AsyncSocket, host: string, port: Port) = var ft = connect(sock, "127.0.0.1", Port(12345)) ft.callback = proc (future: Future[void]) = echo("Connected in

Re: Going to Haxe. Nim In Action book available.

2016-08-13 Thread _tulayang
Look like ECMAScript2015 (JavaScript, or TypeScript) very much ...

Re: Go-lang like interface

2016-08-03 Thread _tulayang
@bpr > That sounds like an anti-feature to me, kind of like the anti-feature of > Python (discussed on another thread here) that allows one to add object > attributes at any time. In Scala, Rust and more modern language, you can change external variable in funcational programming. And, this

Re: Go-lang like interface

2016-08-03 Thread _tulayang
@Krux02 > Yes, and you are ignorant to learn about them. HAHA. I don't learn about Golang because Golang is a lousy language. There are so many good languages better than Golang: C, Nim, Rust, Erlang, Scala, Java, Scheme. > Yes, live with it. "Pure function" are not realistic. Did you know

Re: Go-lang like interface

2016-08-02 Thread _tulayang
@Krux02 > The interface construct in Go works very different from the interface > construct in Java I had to say I didn't see any advantage of Go interface. > Can you tell me why your foobar in your functional solution has a function as > argument, instead of just passing it an int directly?

Re: Go-lang like interface

2016-08-02 Thread _tulayang
@Krux02 I know interface of Java. Go is nothing magical.

Re: Go-lang like interface

2016-08-01 Thread _tulayang
Another solution: import future type MyInterface = ref object of RootRef foo: proc(this: MyInterface): int bar: proc(this: MyInterface): int proc foobar(this: MyInterface): int = return this.foo(this) + this.bar(this) type

Re: Go-lang like interface

2016-08-01 Thread _tulayang
@Krux02 OK. If you're worried about code bloated, the best way is not to use interface, try functional programming (object-oriented programming is inflexible): import future type MyImplementationA = object MyImplementationB = object m_foo,m_bar:

Re: Go-lang like interface

2016-07-31 Thread _tulayang
How about: type MyImplementationA = object MyImplementationB = object m_foo,m_bar: int proc foo(this: MyImplementationA): int = return 17 proc bar(this: MyImplementationA): int = return 4 proc foo(this: