Re: [swift-dev] Breaking change in lexing operators next to comments

2015-12-14 Thread Simon Pilkington via swift-dev
It seems to make more sense to treat comments as this if they are not present.

As a related question, should the presence/absence of whitespace be important 
at all? It seems fragile if it is.

-Simon


> On 14 Dec 2015, at 9:42 PM, Chris Lattner via swift-dev  
> wrote:
> 
>> 
>> On Dec 14, 2015, at 8:15 PM, Jesse Rusak via swift-dev > > wrote:
>> 
>> Hi all,
>> 
>> I’m investigating this bug: https://bugs.swift.org/browse/SR-186 
>> 
>> 
>> Which appears to be a result of the fact that the logic that determines if 
>> an operator is prefix/postfix/binary does not treat comments as whitespace. 
>> So, for example:
>> 
>> /* comment */!foo
>> 
>> does not lex as expected because the “!" thinks it has an something on both 
>> sides and so is treated as a binary operator. 
>> 
>> Fixing this (by treating comments as whitespace here) will break existing 
>> code which relies on the current behavior, such as:
>> 
>> foo/* comment */!
>> 
>> which currently treats the “!” as a postfix operator but will change to 
>> binary. I expect these cases would be rare (maybe in some generated code?), 
>> but the results might be pretty confusing. 
>> 
>> Any objections to fixing this or other thoughts? 
> 
> There are two defensible models here:
> 
> 1) comments should be treated as whitespace.
> 2) comments should be treated as if they were not present.
> 
> The later model seems more ideal to me (because you can put whitespace on 
> either side of the comment after all), but I don’t have a strong opinion 
> about that.  What do others think?
> 
> -Chris
> 
>  ___
> swift-dev mailing list
> swift-dev@swift.org 
> https://lists.swift.org/mailman/listinfo/swift-dev 
> 
___
swift-dev mailing list
swift-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-dev


[swift-dev] Getting an immediate edit-compile-debug cycle for Server Side Swift

2017-04-08 Thread Simon Pilkington via swift-dev
Hi all,

One of the features web developers really appreciate about scripting 
(interpreted) languages such as Javascript/Node for server side development is 
that they provide a virtually immediate edit-compile-debug cycle. A dev makes a 
change to their code, refreshes their browser and see the effects of their 
change without a manual recompile or restarting their server. The downside is 
that in production you also get the overhead of an interpreted language and its 
environment. This has limited the practicality of using scripting languages on 
the server at scale despite the fact that web devs really like using them.

Considering that Swift can effectively be used as an interpreted language with 
the REPL I was wondering if anyone on the Server Side Swift side looked at this 
to create a server that can interpret code (for example to generate the 
response body) on the fly during development but provide the performance 
benefits of natively compiled code in production.

Cheers,
Simon
___
swift-dev mailing list
swift-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-dev